fix for storageRangeAt when block has 0 tx's

This commit is contained in:
cdetrio 2018-11-10 18:29:49 -05:00 committed by Paweł Bylica
parent a9c74bb59a
commit d1469f7a38
No known key found for this signature in database
GPG key ID: 7A0C037434FE77EF

View file

@ -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)