aboutsummaryrefslogtreecommitdiffstats
path: root/core/chain_makers.go
diff options
context:
space:
mode:
authorJeffrey Wilcke <jeffrey@ethereum.org>2015-10-16 21:18:41 +0800
committerJeffrey Wilcke <jeffrey@ethereum.org>2015-10-16 21:18:41 +0800
commitb74775400906cc582bdbb98bf5067c5258ee491f (patch)
treefefd9cfe28ce5b409d58c70b03cf4a6d6dc84873 /core/chain_makers.go
parentf466243417f60531998e8b500f2bb043af5b3d2a (diff)
parent1b1f293082044c43d8d1c5df9ac40aab8fdb2ae8 (diff)
downloadgo-tangerine-b74775400906cc582bdbb98bf5067c5258ee491f.tar
go-tangerine-b74775400906cc582bdbb98bf5067c5258ee491f.tar.gz
go-tangerine-b74775400906cc582bdbb98bf5067c5258ee491f.tar.bz2
go-tangerine-b74775400906cc582bdbb98bf5067c5258ee491f.tar.lz
go-tangerine-b74775400906cc582bdbb98bf5067c5258ee491f.tar.xz
go-tangerine-b74775400906cc582bdbb98bf5067c5258ee491f.tar.zst
go-tangerine-b74775400906cc582bdbb98bf5067c5258ee491f.zip
Merge pull request #1881 from Gustav-Simonsson/state_new_error
core/state, core, miner: handle missing root error from state.New
Diffstat (limited to 'core/chain_makers.go')
-rw-r--r--core/chain_makers.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/chain_makers.go b/core/chain_makers.go
index ba09b3029..4347d9173 100644
--- a/core/chain_makers.go
+++ b/core/chain_makers.go
@@ -156,7 +156,10 @@ func (b *BlockGen) OffsetTime(seconds int64) {
// values. Inserting them into BlockChain requires use of FakePow or
// a similar non-validating proof of work implementation.
func GenerateChain(parent *types.Block, db ethdb.Database, n int, gen func(int, *BlockGen)) []*types.Block {
- statedb := state.New(parent.Root(), db)
+ statedb, err := state.New(parent.Root(), db)
+ if err != nil {
+ panic(err)
+ }
blocks := make(types.Blocks, n)
genblock := func(i int, h *types.Header) *types.Block {
b := &BlockGen{parent: parent, i: i, chain: blocks, header: h, statedb: statedb}