Skip to content

Commit

Permalink
consensus/parlia: set nonce before evm run
Browse files Browse the repository at this point in the history
  • Loading branch information
buddh0 committed Jan 26, 2024
1 parent fecd2bf commit 8b35f47
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion consensus/parlia/parlia.go
Original file line number Diff line number Diff line change
Expand Up @@ -1751,7 +1751,6 @@ func (p *Parlia) applyTransaction(
receipt.BlockNumber = header.Number
receipt.TransactionIndex = uint(state.TxIndex())
*receipts = append(*receipts, receipt)
state.SetNonce(msg.From(), nonce+1)
return nil
}

Expand Down Expand Up @@ -1975,6 +1974,8 @@ func applyMessage(
// about the transaction and calling mechanisms.
vmenv := vm.NewEVM(context, vm.TxContext{Origin: msg.From(), GasPrice: big.NewInt(0)}, state, chainConfig, vm.Config{})
// Apply the transaction to the current state (included in the env)
// Increment the nonce for the next transaction
state.SetNonce(msg.From(), state.GetNonce(msg.From())+1)
ret, returnGas, err := vmenv.Call(
vm.AccountRef(msg.From()),
*msg.To(),
Expand Down

0 comments on commit 8b35f47

Please sign in to comment.