diff --git a/core/types/transaction.go b/core/types/transaction.go index e551d23796..1a87a679a9 100644 --- a/core/types/transaction.go +++ b/core/types/transaction.go @@ -726,3 +726,5 @@ func (m Message) Gas() uint64 { return m.gasLimit } func (m Message) Nonce() uint64 { return m.nonce } func (m Message) Data() []byte { return m.data } func (m Message) CheckNonce() bool { return m.checkNonce } + +func (m *Message) SetNonce(nonce uint64) { m.nonce = nonce } diff --git a/eth/api_tracer.go b/eth/api_tracer.go index bddff0ccd3..b8c4661a91 100644 --- a/eth/api_tracer.go +++ b/eth/api_tracer.go @@ -471,6 +471,8 @@ func (api *PrivateDebugAPI) traceBlock(ctx context.Context, block *types.Block, } // Generate the next state snapshot fast without tracing msg, _ := tx.AsMessage(signer, balacne, block.Number()) + // Set nonce to fix issue #256 + msg.SetNonce(statedb.GetNonce(*tx.From())) vmctx := core.NewEVMContext(msg, block.Header(), api.eth.blockchain, nil) vmenv := vm.NewEVM(vmctx, statedb, XDCxState, api.config, vm.Config{})