aboutsummaryrefslogtreecommitdiffstats
path: root/core/tx_pool.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2018-03-07 16:55:59 +0800
committerPéter Szilágyi <peterke@gmail.com>2018-03-07 16:58:11 +0800
commit2b5d1a4a4cf33292267840aaf2952e2caa441447 (patch)
treed676befc6861e341ee53a093f11153db01d01069 /core/tx_pool.go
parentf8601430fddfe44b9c1781957ab13578cf17ad9f (diff)
downloadgo-tangerine-2b5d1a4a4cf33292267840aaf2952e2caa441447.tar
go-tangerine-2b5d1a4a4cf33292267840aaf2952e2caa441447.tar.gz
go-tangerine-2b5d1a4a4cf33292267840aaf2952e2caa441447.tar.bz2
go-tangerine-2b5d1a4a4cf33292267840aaf2952e2caa441447.tar.lz
go-tangerine-2b5d1a4a4cf33292267840aaf2952e2caa441447.tar.xz
go-tangerine-2b5d1a4a4cf33292267840aaf2952e2caa441447.tar.zst
go-tangerine-2b5d1a4a4cf33292267840aaf2952e2caa441447.zip
core: update txpool tests for the removal fix
Diffstat (limited to 'core/tx_pool.go')
-rw-r--r--core/tx_pool.go6
1 files changed, 2 insertions, 4 deletions
diff --git a/core/tx_pool.go b/core/tx_pool.go
index 7d7ed334a..089bd215a 100644
--- a/core/tx_pool.go
+++ b/core/tx_pool.go
@@ -877,17 +877,15 @@ func (pool *TxPool) removeTx(hash common.Hash) {
// Remove the transaction from the pending lists and reset the account nonce
if pending := pool.pending[addr]; pending != nil {
if removed, invalids := pending.Remove(tx); removed {
- // If no more transactions are left, remove the list
+ // If no more pending transactions are left, remove the list
if pending.Empty() {
delete(pool.pending, addr)
delete(pool.beats, addr)
}
-
- // Otherwise postpone any invalidated transactions
+ // Postpone any invalidated transactions
for _, tx := range invalids {
pool.enqueueTx(tx.Hash(), tx)
}
-
// Update the account nonce if needed
if nonce := tx.Nonce(); pool.pendingState.GetNonce(addr) > nonce {
pool.pendingState.SetNonce(addr, nonce)