core: transaction nonce recovery fix
When the transaction state recovery kicked in it assigned the last (incorrect) nonce to the pending state which caused transactions with the same nonce to occur. Added test for nonce recovery
This commit is contained in:
@ -121,8 +121,8 @@ func (pool *TxPool) resetState() {
|
||||
if addr, err := tx.From(); err == nil {
|
||||
// Set the nonce. Transaction nonce can never be lower
|
||||
// than the state nonce; validatePool took care of that.
|
||||
if pool.pendingState.GetNonce(addr) < tx.Nonce() {
|
||||
pool.pendingState.SetNonce(addr, tx.Nonce())
|
||||
if pool.pendingState.GetNonce(addr) <= tx.Nonce() {
|
||||
pool.pendingState.SetNonce(addr, tx.Nonce()+1)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user