blockchain: during fastAdd or if block wasn't already valid, mark as valid in index

This commit is contained in:
Olaoluwa Osuntokun 2018-08-08 18:31:15 -07:00
parent 598808cfd0
commit 69f313436f
No known key found for this signature in database
GPG key ID: 964EA263DD637C21

View file

@ -1158,6 +1158,14 @@ func (b *BlockChain) connectBestChain(node *blockNode, block *btcutil.Block, fla
return false, err
}
// If this is fast add, or this block node isn't yet marked as
// valid, then we'll update its status and flush the state to
// disk again.
if fastAdd || !b.index.NodeStatus(node).KnownValid() {
b.index.SetStatusFlags(node, statusValid)
flushIndexState()
}
return true, nil
}
if fastAdd {