Skip to content

Commit

Permalink
fixup! blockchain: flush the utxo cache on prune if needed
Browse files Browse the repository at this point in the history
  • Loading branch information
kcalvinalvin committed Dec 5, 2023
1 parent e47ea95 commit 4fce9c0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions blockchain/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -653,9 +653,8 @@ func (b *BlockChain) connectBlock(node *blockNode, block *btcutil.Block,
return err
}
if needsFlush {
// Flush the utxo cache. This is a different db.Update
// and it'll commit before this current db.Update is
// committed.
// Since the deleted hashes are past our last
// flush block, flush the utxo cache now.
err = b.utxoCache.flush(dbTx, FlushRequired, state)
if err != nil {
return err
Expand Down

0 comments on commit 4fce9c0

Please sign in to comment.