forked from btcsuite/btcd
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
blockchain: change reorg utxo cache behavior
The assumption in the previous code was incorrect in that we were assuming that the chainLock is held throughout the entire chain reorg. This is not the case since the chainLock is let go of during the callback to the subscribers. Because of this, we need to ensure that the utxo set is consistent on each block disconnect. To achieve this, additional flushes are added during block disconnects. Also the utxocache is no longer avoided during block connects and when we're checking for the validity of the block connects and disconnects as we can just use the cache instead of trying to avoid it.
- Loading branch information
1 parent
003d6e5
commit 65ecf4a
Showing
1 changed file
with
47 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters