core: fixed genesis write out to write only canon number
This commit is contained in:
@ -27,6 +27,8 @@ import (
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/ethereum/go-ethereum/core/state"
|
||||
"github.com/ethereum/go-ethereum/core/types"
|
||||
"github.com/ethereum/go-ethereum/logger"
|
||||
"github.com/ethereum/go-ethereum/logger/glog"
|
||||
"github.com/ethereum/go-ethereum/params"
|
||||
)
|
||||
|
||||
@ -83,7 +85,12 @@ func WriteGenesisBlock(stateDb, blockDb common.Database, reader io.Reader) (*typ
|
||||
block.Td = difficulty
|
||||
|
||||
if block := GetBlockByHash(blockDb, block.Hash()); block != nil {
|
||||
return nil, fmt.Errorf("Block %x already in database", block.Hash())
|
||||
glog.V(logger.Info).Infoln("Genesis block already in chain. Writing canonical number")
|
||||
err := WriteCanonNumber(blockDb, block)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return block, nil
|
||||
}
|
||||
|
||||
statedb.Sync()
|
||||
|
Reference in New Issue
Block a user