ante: update nonce check (#550)

This commit is contained in:
noot
2020-09-29 10:39:15 -04:00
committed by GitHub
parent cee4c5f31f
commit 7f648d2c55
2 changed files with 10 additions and 1 deletions
+4 -1
View File
@@ -253,7 +253,10 @@ func (nvd NonceVerificationDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, sim
}
seq := acc.GetSequence()
if msgEthTx.Data.AccountNonce != seq {
// if multiple transactions are submitted in succession with increasing nonces,
// all will be rejected except the first, since the first needs to be included in a block
// before the sequence increments
if msgEthTx.Data.AccountNonce < seq {
return ctx, sdkerrors.Wrapf(
sdkerrors.ErrInvalidSequence,
"invalid nonce; got %d, expected %d", msgEthTx.Data.AccountNonce, seq,