mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-19 21:31:37 +00:00
Merge pull request #260 from gzliudan/fix-issue-256
fix "nonce too low" error when call debug_traceBlock api
This commit is contained in:
commit
3e466b6bc1
2 changed files with 4 additions and 0 deletions
|
|
@ -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 }
|
||||
|
|
|
|||
|
|
@ -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{})
|
||||
|
|
|
|||
Loading…
Reference in a new issue