From 4fce9c01c50187a430b10aaeefdaf0eb1b6e06d5 Mon Sep 17 00:00:00 2001 From: Calvin Kim Date: Tue, 5 Dec 2023 13:09:33 +0900 Subject: [PATCH] fixup! blockchain: flush the utxo cache on prune if needed --- blockchain/chain.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/blockchain/chain.go b/blockchain/chain.go index f2b842ab54b..dd87ddf7a5a 100644 --- a/blockchain/chain.go +++ b/blockchain/chain.go @@ -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