mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 02:12:23 +00:00
core: re-enqueue overflow tx to future queue
This commit is contained in:
parent
ed40767355
commit
d58702da69
1 changed files with 6 additions and 10 deletions
|
|
@ -996,16 +996,14 @@ func (pool *TxPool) promoteExecutables(accounts []common.Address) {
|
||||||
for i := 0; i < len(offenders)-1; i++ {
|
for i := 0; i < len(offenders)-1; i++ {
|
||||||
list := pool.pending[offenders[i]]
|
list := pool.pending[offenders[i]]
|
||||||
for _, tx := range list.Cap(list.Len() - 1) {
|
for _, tx := range list.Cap(list.Len() - 1) {
|
||||||
// Drop the transaction from the global pools too
|
// Re-enqueue transaction to future queue.
|
||||||
hash := tx.Hash()
|
pool.enqueueTx(tx.Hash(), tx)
|
||||||
pool.all.Remove(hash)
|
|
||||||
pool.priced.Removed()
|
|
||||||
|
|
||||||
// Update the account nonce to the dropped transaction
|
// Update the account nonce to the dropped transaction
|
||||||
if nonce := tx.Nonce(); pool.pendingState.GetNonce(offenders[i]) > nonce {
|
if nonce := tx.Nonce(); pool.pendingState.GetNonce(offenders[i]) > nonce {
|
||||||
pool.pendingState.SetNonce(offenders[i], nonce)
|
pool.pendingState.SetNonce(offenders[i], nonce)
|
||||||
}
|
}
|
||||||
log.Trace("Removed fairness-exceeding pending transaction", "hash", hash)
|
log.Trace("Re-enqueue fairness-exceeding pending transaction", "hash", tx.Hash())
|
||||||
}
|
}
|
||||||
pending--
|
pending--
|
||||||
}
|
}
|
||||||
|
|
@ -1018,16 +1016,14 @@ func (pool *TxPool) promoteExecutables(accounts []common.Address) {
|
||||||
for _, addr := range offenders {
|
for _, addr := range offenders {
|
||||||
list := pool.pending[addr]
|
list := pool.pending[addr]
|
||||||
for _, tx := range list.Cap(list.Len() - 1) {
|
for _, tx := range list.Cap(list.Len() - 1) {
|
||||||
// Drop the transaction from the global pools too
|
// Re-enqueue transaction to future queue.
|
||||||
hash := tx.Hash()
|
pool.enqueueTx(tx.Hash(), tx)
|
||||||
pool.all.Remove(hash)
|
|
||||||
pool.priced.Removed()
|
|
||||||
|
|
||||||
// Update the account nonce to the dropped transaction
|
// Update the account nonce to the dropped transaction
|
||||||
if nonce := tx.Nonce(); pool.pendingState.GetNonce(addr) > nonce {
|
if nonce := tx.Nonce(); pool.pendingState.GetNonce(addr) > nonce {
|
||||||
pool.pendingState.SetNonce(addr, nonce)
|
pool.pendingState.SetNonce(addr, nonce)
|
||||||
}
|
}
|
||||||
log.Trace("Removed fairness-exceeding pending transaction", "hash", hash)
|
log.Trace("Re-enqueue fairness-exceeding pending transaction", "hash", tx.Hash())
|
||||||
}
|
}
|
||||||
pending--
|
pending--
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue