eth: simplify accountRangeAt

This commit is contained in:
Jared Wasinger 2019-05-30 03:07:35 +00:00 committed by Guillaume Ballet
parent 407ff0f945
commit a32c95b156

View file

@ -378,11 +378,7 @@ func (api *PrivateDebugAPI) AccountRangeAt(ctx context.Context, start *common.Ha
block := api.eth.blockchain.CurrentBlock() block := api.eth.blockchain.CurrentBlock()
if len(block.Transactions()) == 0 { if len(block.Transactions()) == 0 {
parent := api.eth.blockchain.GetBlock(block.ParentHash(), block.NumberU64()-1) statedb, err = api.computeStateDB(block, defaultTraceReexec)
if parent == nil {
return AccountRangeResult{}, fmt.Errorf("parent %x not found", block.ParentHash())
}
statedb, err = api.computeStateDB(parent, defaultTraceReexec)
if err != nil { if err != nil {
return AccountRangeResult{}, err return AccountRangeResult{}, err
} }