Fix nonce issue for replay attack (#692)

* fix nonce issue for replay attack

* fix lint

* add to changelog
This commit is contained in:
Daniel Choi
2021-01-08 22:44:50 -03:00
committed by GitHub
parent 4a619b1e1b
commit d7bdbd7488
3 changed files with 10 additions and 8 deletions
+1 -1
View File
@@ -257,7 +257,7 @@ func (nvd NonceVerificationDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, sim
// 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 {
if msgEthTx.Data.AccountNonce != seq {
return ctx, sdkerrors.Wrapf(
sdkerrors.ErrInvalidSequence,
"invalid nonce; got %d, expected %d", msgEthTx.Data.AccountNonce, seq,