Skip to content

Commit

Permalink
blockchain: Initialize database with genesis block.
Browse files Browse the repository at this point in the history
This fixes a bug introduced by decred#1066.
  • Loading branch information
jimpo authored and jrick committed Feb 9, 2018
1 parent 50de9da commit 0ef0d8c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions blockchain/chainio.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 0ef0d8c

Please sign in to comment.