aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeffrey Wilcke <jeffrey@ethereum.org>2015-06-09 17:55:47 +0800
committerJeffrey Wilcke <jeffrey@ethereum.org>2015-06-09 17:55:47 +0800
commit11f65cf885317d6c355b4c4a8d7420bcb82839d1 (patch)
tree33b99a5baee2561407548142d191b27c3792c80d
parent0f1cdfa53ad445df7bf3aed281fc36e53ecbbfd4 (diff)
parenta5b977aa9042b8b5199067d435c5cbd3f6459834 (diff)
downloaddexon-11f65cf885317d6c355b4c4a8d7420bcb82839d1.tar
dexon-11f65cf885317d6c355b4c4a8d7420bcb82839d1.tar.gz
dexon-11f65cf885317d6c355b4c4a8d7420bcb82839d1.tar.bz2
dexon-11f65cf885317d6c355b4c4a8d7420bcb82839d1.tar.lz
dexon-11f65cf885317d6c355b4c4a8d7420bcb82839d1.tar.xz
dexon-11f65cf885317d6c355b4c4a8d7420bcb82839d1.tar.zst
dexon-11f65cf885317d6c355b4c4a8d7420bcb82839d1.zip
Merge pull request #1211 from obscuren/genesis_writout_fix
core: write accounts to statedb. Closes #1210
-rw-r--r--core/chain_manager.go13
-rw-r--r--eth/backend.go2
2 files changed, 8 insertions, 7 deletions
diff --git a/core/chain_manager.go b/core/chain_manager.go
index e87253304..a0ce20006 100644
--- a/core/chain_manager.go
+++ b/core/chain_manager.go
@@ -111,12 +111,13 @@ type ChainManager struct {
func NewChainManager(genesis *types.Block, blockDb, stateDb common.Database, pow pow.PoW, mux *event.TypeMux) (*ChainManager, error) {
bc := &ChainManager{
- blockDb: blockDb,
- stateDb: stateDb,
- eventMux: mux,
- quit: make(chan struct{}),
- cache: NewBlockCache(blockCacheLimit),
- pow: pow,
+ blockDb: blockDb,
+ stateDb: stateDb,
+ genesisBlock: GenesisBlock(42, stateDb),
+ eventMux: mux,
+ quit: make(chan struct{}),
+ cache: NewBlockCache(blockCacheLimit),
+ pow: pow,
}
// Check the genesis block given to the chain manager. If the genesis block mismatches block number 0
diff --git a/eth/backend.go b/eth/backend.go
index 06627416d..fcbea04a2 100644
--- a/eth/backend.go
+++ b/eth/backend.go
@@ -285,7 +285,7 @@ func New(config *Config) (*Ethereum, error) {
}
eth.pow = ethash.New()
- genesis := core.GenesisBlock(uint64(config.GenesisNonce), blockDb)
+ genesis := core.GenesisBlock(uint64(config.GenesisNonce), stateDb)
eth.chainManager, err = core.NewChainManager(genesis, blockDb, stateDb, eth.pow, eth.EventMux())
if err != nil {
return nil, err