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

@ -443,10 +443,11 @@ func testGetNodeData(t *testing.T, protocol int) {
}
accounts := []common.Address{testBankAddress, acc1Addr, acc2Addr}
for i := uint64(0); i <= pm.blockchain.CurrentBlock().NumberU64(); i++ {
trie := state.New(pm.blockchain.GetBlockByNumber(i).Root(), statedb)
trie, _ := state.New(pm.blockchain.GetBlockByNumber(i).Root(), statedb)
for j, acc := range accounts {
bw := pm.blockchain.State().GetBalance(acc)
state, _ := pm.blockchain.State()
bw := state.GetBalance(acc)
bh := trie.GetBalance(acc)
if (bw != nil && bh == nil) || (bw == nil && bh != nil) {