fix: improve nonce too low error (#10711)

This commit is contained in:
Panagiotis Ganelis
2024-09-05 16:09:33 +03:00
committed by GitHub
parent 834e99cd2a
commit 8bbd403285
4 changed files with 32 additions and 12 deletions

View File

@ -359,11 +359,14 @@ where
}
}
let tx_nonce = transaction.nonce();
// Checks for nonce
if transaction.nonce() < account.nonce {
if tx_nonce < account.nonce {
return TransactionValidationOutcome::Invalid(
transaction,
InvalidTransactionError::NonceNotConsistent.into(),
InvalidTransactionError::NonceNotConsistent { tx: tx_nonce, state: account.nonce }
.into(),
)
}