forked from cerc-io/laconicd-deprecated
Nonce increase in ante handler (#165)
* Change nonce to be incremented in pending state during ante handler instead of skipping * remove unnecessary sim check
This commit is contained in:
parent
51adade59f
commit
35b16abe51
13
app/ante.go
13
app/ante.go
@ -155,15 +155,12 @@ func ethAnteHandler(
|
||||
gas, _ := ethcore.IntrinsicGas(ethTxMsg.Data.Payload, ethTxMsg.To() == nil, true)
|
||||
newCtx.GasMeter().ConsumeGas(gas, "eth intrinsic gas")
|
||||
|
||||
// no need to increment sequence on CheckTx or RecheckTx
|
||||
if !(ctx.IsCheckTx() && !sim) {
|
||||
// increment sequence of sender
|
||||
acc := ak.GetAccount(ctx, senderAddr)
|
||||
if err := acc.SetSequence(acc.GetSequence() + 1); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
ak.SetAccount(ctx, acc)
|
||||
// Increment sequence of sender
|
||||
acc := ak.GetAccount(ctx, senderAddr)
|
||||
if err := acc.SetSequence(acc.GetSequence() + 1); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
ak.SetAccount(ctx, acc)
|
||||
|
||||
return newCtx, nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user