core: reduce CPU load by reducing calls to checkQueue
* Reduced maxQueue count * Added proper deletion past maxQueue limit * Added cheap stats method to txpool queueCheck was called for **every** transaction instead of: 1. add all txs 2. check queue previously 1. add txs[i] 2. check queue 3. if i < len(txs) goto 1.
This commit is contained in:
@ -181,6 +181,8 @@ func TestTransactionDoubleNonce(t *testing.T) {
|
||||
if err := pool.add(tx2); err != nil {
|
||||
t.Error("didn't expect error", err)
|
||||
}
|
||||
|
||||
pool.checkQueue()
|
||||
if len(pool.pending) != 2 {
|
||||
t.Error("expected 2 pending txs. Got", len(pool.pending))
|
||||
}
|
||||
|
Reference in New Issue
Block a user