blockchain: Initialize database with genesis block.
This fixes a bug introduced by #1066.
This commit is contained in:
parent
50de9da05b
commit
0ef0d8c59b
1 changed files with 6 additions and 0 deletions
|
@ -1125,6 +1125,12 @@ func (b *BlockChain) createChainState() error {
|
|||
return err
|
||||
}
|
||||
|
||||
// Save the genesis block to the block index database.
|
||||
err = dbStoreBlockNode(dbTx, node)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Add the genesis block hash to height and height to hash
|
||||
// mappings to the index.
|
||||
err = dbPutBlockIndex(dbTx, &node.hash, node.height)
|
||||
|
|
Loading…
Reference in a new issue