From 99c2de7c0df891080919d4da9caeda9b11718e4f Mon Sep 17 00:00:00 2001 From: StephenButtolph Date: Sat, 7 Sep 2019 18:26:31 -0400 Subject: Added helpers for removing Noops --- coreth.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/coreth.go b/coreth.go index 1683024..c4cbf09 100644 --- a/coreth.go +++ b/coreth.go @@ -64,8 +64,17 @@ func (self *ETHChain) GenBlock() { self.backend.Miner().GenBlock() } +func (self *ETHChain) PendingSize() (int, error) { + pending, err := self.backend.TxPool().Pending() + count := 0 + for _, txs := range pending { + count += len(txs) + } + return count, err +} + func (self *ETHChain) AddRemoteTxs(txs []*types.Transaction) []error { - return self.backend.TxPool().AddRemotes(txs) + return self.backend.TxPool().AddRemotesSync(txs) } func (self *ETHChain) AddLocalTxs(txs []*types.Transaction) []error { -- cgit v1.2.3