-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
blockchain: Fix inconsistent state bugs
There were a few bugs alleviated in this commit: 1: On block disconnects, spend journals were being removed first before the cache was flushed. This could leave the cache at an unrecoverable state as it no longer has the spend journal to roll back a given block. 2: On block disconnects, stateLock unlock was happening after the err return which would leave the lock locked. 3: On utxo cache inconsistent state checks, last flushed hash wasn't being set correctly. 4: On utxo cache inconsistent state checks, cache flush wasn't being called, which leaves the cache full and leaves the node at a stuck state. 5: On utxo cache inconsistent state checks, consistent state would be updated during block connects without a cache flush, which would leave the utxo set in an inconsistent state if a sudden crash or user interrupt were to happen during the utxo set rebuilding.
- Loading branch information
1 parent
47cb61a
commit 0112042
Showing
2 changed files
with
83 additions
and
62 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
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