core/state, core, miner: handle missing root error from state.New

This commit is contained in:
Gustav Simonsson
2015-10-06 16:35:55 +02:00
parent f466243417
commit 1b1f293082
23 changed files with 182 additions and 95 deletions

View File

@ -119,9 +119,9 @@ func (self *debugApi) DumpBlock(req *shared.Request) (interface{}, error) {
return nil, fmt.Errorf("block #%d not found", args.BlockNumber)
}
stateDb := state.New(block.Root(), self.ethereum.ChainDb())
if stateDb == nil {
return nil, nil
stateDb, err := state.New(block.Root(), self.ethereum.ChainDb())
if err != nil {
return nil, err
}
return stateDb.RawDump(), nil