mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-20 21:54:30 +00:00
core: make txpool free space calculation more accurate (#22933)
This commit is contained in:
parent
684afd0b18
commit
d88d2670e5
1 changed files with 1 additions and 1 deletions
|
|
@ -711,7 +711,7 @@ func (pool *TxPool) add(tx *types.Transaction, local bool) (replaced bool, err e
|
|||
return pool.promoteSpecialTx(from, tx, isLocal)
|
||||
}
|
||||
// If the transaction pool is full, discard underpriced transactions
|
||||
if uint64(pool.all.Count()) >= pool.config.GlobalSlots+pool.config.GlobalQueue {
|
||||
if uint64(pool.all.Slots()+numSlots(tx)) > pool.config.GlobalSlots+pool.config.GlobalQueue {
|
||||
log.Debug("Add transaction to pool full", "hash", hash, "nonce", tx.Nonce())
|
||||
// If the new transaction is underpriced, don't accept it
|
||||
if !isLocal && pool.priced.Underpriced(tx) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue