From d1469f7a387d1d9ef32f21068ed5b8af606115d4 Mon Sep 17 00:00:00 2001 From: cdetrio Date: Sat, 10 Nov 2018 18:29:49 -0500 Subject: [PATCH] fix for storageRangeAt when block has 0 tx's --- eth/api_tracer.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/eth/api_tracer.go b/eth/api_tracer.go index 2ebbcc5fd9..28b40b06c9 100644 --- a/eth/api_tracer.go +++ b/eth/api_tracer.go @@ -649,6 +649,10 @@ func (api *PrivateDebugAPI) computeTxEnv(blockHash common.Hash, txIndex int, ree // Recompute transactions up to the target index. signer := types.MakeSigner(api.config, block.Number()) + if len(block.Transactions()) == 0 { + return nil, vm.Context{}, statedb, nil + } + for idx, tx := range block.Transactions() { // Assemble the transaction call message and return if the requested offset msg, _ := tx.AsMessage(signer)