From 49a7ee460e839499ef41f5110b219ec8c8edc5e8 Mon Sep 17 00:00:00 2001 From: cdetrio Date: Fri, 12 Jul 2019 11:43:07 -0400 Subject: [PATCH] eth: fix storageRangeAt for empty blocks (#18076) --- eth/api_tracer.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/eth/api_tracer.go b/eth/api_tracer.go index 2800ff659..ce211cbd9 100644 --- a/eth/api_tracer.go +++ b/eth/api_tracer.go @@ -795,6 +795,11 @@ func (api *PrivateDebugAPI) computeTxEnv(blockHash common.Hash, txIndex int, ree if err != nil { return nil, vm.Context{}, nil, err } + + if txIndex == 0 && len(block.Transactions()) == 0 { + return nil, vm.Context{}, statedb, nil + } + // Recompute transactions up to the target index. signer := types.MakeSigner(api.eth.blockchain.Config(), block.Number())