mirror of
https://gitlab.com/pulsechaincom/go-pulse.git
synced 2025-01-03 09:17:38 +00:00
core/txpool: fix minor flaw in isGapped check (#27404)
This fix a minor implementation issue with the newly introduced isGapped function and it is described in ticket: https://github.com/ethereum/go-ethereum/issues/27401
This commit is contained in:
parent
8eb0c2de76
commit
b8ee2877c5
@ -823,10 +823,12 @@ func (pool *TxPool) add(tx *types.Transaction, local bool) (replaced bool, err e
|
|||||||
|
|
||||||
// isGapped reports whether the given transaction is immediately executable.
|
// isGapped reports whether the given transaction is immediately executable.
|
||||||
func (pool *TxPool) isGapped(from common.Address, tx *types.Transaction) bool {
|
func (pool *TxPool) isGapped(from common.Address, tx *types.Transaction) bool {
|
||||||
// Short circuit if transaction matches pending nonce and can be promoted
|
// Short circuit if transaction falls within the scope of the pending list
|
||||||
// to pending list as an executable transaction.
|
// or matches the next pending nonce which can be promoted as an executable
|
||||||
|
// transaction afterwards. Note, the tx staleness is already checked in
|
||||||
|
// 'validateTx' function previously.
|
||||||
next := pool.pendingNonces.get(from)
|
next := pool.pendingNonces.get(from)
|
||||||
if tx.Nonce() == next {
|
if tx.Nonce() <= next {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
// The transaction has a nonce gap with pending list, it's only considered
|
// The transaction has a nonce gap with pending list, it's only considered
|
||||||
|
Loading…
Reference in New Issue
Block a user