diff --git a/CHANGELOG_PENDING.md b/CHANGELOG_PENDING.md index 3cc491fe8..bcbeb4963 100644 --- a/CHANGELOG_PENDING.md +++ b/CHANGELOG_PENDING.md @@ -24,5 +24,6 @@ Special thanks to external contributors on this release: ### BUG FIXES: - [kv indexer] \#2912 don't ignore key when executing CONTAINS +- [mempool] \#2961 notifyTxsAvailable if there're txs left after committing a block, but recheck=false - [mempool] \#2994 Don't allow txs with negative gas wanted - [p2p] \#2715 fix a bug where seeds don't disconnect from a peer after 3h diff --git a/mempool/mempool.go b/mempool/mempool.go index 404683158..c5f966c4e 100644 --- a/mempool/mempool.go +++ b/mempool/mempool.go @@ -556,13 +556,18 @@ func (mem *Mempool) Update( // Remove committed transactions. txsLeft := mem.removeTxs(txs) - // Recheck mempool txs if any txs were committed in the block - if mem.config.Recheck && len(txsLeft) > 0 { - mem.logger.Info("Recheck txs", "numtxs", len(txsLeft), "height", height) - mem.recheckTxs(txsLeft) - // At this point, mem.txs are being rechecked. - // mem.recheckCursor re-scans mem.txs and possibly removes some txs. - // Before mem.Reap(), we should wait for mem.recheckCursor to be nil. + // Either recheck non-committed txs to see if they became invalid + // or just notify there're some txs left. + if len(txsLeft) > 0 { + if mem.config.Recheck { + mem.logger.Info("Recheck txs", "numtxs", len(txsLeft), "height", height) + mem.recheckTxs(txsLeft) + // At this point, mem.txs are being rechecked. + // mem.recheckCursor re-scans mem.txs and possibly removes some txs. + // Before mem.Reap(), we should wait for mem.recheckCursor to be nil. + } else { + mem.notifyTxsAvailable() + } } // Update metrics