Skip to content

Commit 11f65cf

Browse files
committed
Merge pull request #1211 from obscuren/genesis_writout_fix
core: write accounts to statedb. Closes #1210
2 parents 0f1cdfa + a5b977a commit 11f65cf

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

core/chain_manager.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,13 @@ type ChainManager struct {
111111

112112
func NewChainManager(genesis *types.Block, blockDb, stateDb common.Database, pow pow.PoW, mux *event.TypeMux) (*ChainManager, error) {
113113
bc := &ChainManager{
114-
blockDb: blockDb,
115-
stateDb: stateDb,
116-
eventMux: mux,
117-
quit: make(chan struct{}),
118-
cache: NewBlockCache(blockCacheLimit),
119-
pow: pow,
114+
blockDb: blockDb,
115+
stateDb: stateDb,
116+
genesisBlock: GenesisBlock(42, stateDb),
117+
eventMux: mux,
118+
quit: make(chan struct{}),
119+
cache: NewBlockCache(blockCacheLimit),
120+
pow: pow,
120121
}
121122

122123
// Check the genesis block given to the chain manager. If the genesis block mismatches block number 0

eth/backend.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ func New(config *Config) (*Ethereum, error) {
285285
}
286286

287287
eth.pow = ethash.New()
288-
genesis := core.GenesisBlock(uint64(config.GenesisNonce), blockDb)
288+
genesis := core.GenesisBlock(uint64(config.GenesisNonce), stateDb)
289289
eth.chainManager, err = core.NewChainManager(genesis, blockDb, stateDb, eth.pow, eth.EventMux())
290290
if err != nil {
291291
return nil, err

0 commit comments

Comments
 (0)