Put best state with parent's workSum

This commit is contained in:
Nisen 2019-03-03 10:15:47 +08:00
parent 306aecffea
commit 9e6e1de24e

View file

@ -722,7 +722,7 @@ func (b *BlockChain) disconnectBlock(node *blockNode, block *btcutil.Block, view
err = b.db.Update(func(dbTx database.Tx) error {
// Update best block state.
err := dbPutBestState(dbTx, state, node.workSum)
err := dbPutBestState(dbTx, state, node.parent.workSum)
if err != nil {
return err
}