Merge pull request #1569 from obscuren/default-genesis

core: added default genesis block
This commit is contained in:
Jeffrey Wilcke 2015-08-03 04:49:30 -07:00
commit db988a46dd
3 changed files with 40 additions and 2 deletions

View File

@ -98,7 +98,15 @@ func NewChainManager(blockDb, stateDb, extraDb common.Database, pow pow.PoW, mux
bc.genesisBlock = bc.GetBlockByNumber(0)
if bc.genesisBlock == nil {
return nil, ErrNoGenesis
reader, err := NewDefaultGenesisReader()
if err != nil {
return nil, err
}
bc.genesisBlock, err = WriteGenesisBlock(stateDb, blockDb, reader)
if err != nil {
return nil, err
}
glog.V(logger.Info).Infoln("WARNING: Wrote default ethereum genesis block")
}
if err := bc.setLastState(); err != nil {

30
core/default_genesis.go Normal file

File diff suppressed because one or more lines are too long

View File

@ -135,7 +135,7 @@ func (pool *TxPool) resetState() {
func (pool *TxPool) Stop() {
close(pool.quit)
pool.events.Unsubscribe()
glog.V(logger.Info).Infoln("TX Pool stopped")
glog.V(logger.Info).Infoln("Transaction pool stopped")
}
func (pool *TxPool) State() *state.ManagedState {