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
@ -155,15 +155,12 @@ func ethAnteHandler(
|
|||||||
gas, _ := ethcore.IntrinsicGas(ethTxMsg.Data.Payload, ethTxMsg.To() == nil, true)
|
gas, _ := ethcore.IntrinsicGas(ethTxMsg.Data.Payload, ethTxMsg.To() == nil, true)
|
||||||
newCtx.GasMeter().ConsumeGas(gas, "eth intrinsic gas")
|
newCtx.GasMeter().ConsumeGas(gas, "eth intrinsic gas")
|
||||||
|
|
||||||
// no need to increment sequence on CheckTx or RecheckTx
|
// Increment sequence of sender
|
||||||
if !(ctx.IsCheckTx() && !sim) {
|
|
||||||
// increment sequence of sender
|
|
||||||
acc := ak.GetAccount(ctx, senderAddr)
|
acc := ak.GetAccount(ctx, senderAddr)
|
||||||
if err := acc.SetSequence(acc.GetSequence() + 1); err != nil {
|
if err := acc.SetSequence(acc.GetSequence() + 1); err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
ak.SetAccount(ctx, acc)
|
ak.SetAccount(ctx, acc)
|
||||||
}
|
|
||||||
|
|
||||||
return newCtx, nil
|
return newCtx, nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user