Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
blockchain: in initChainState mark ancestors of best tip as valid if …
…not marked In this commit, we add an additional consistency check within the `initChainState` method. It has been observed that at times, a block wil lbe written to disk (as it's valid), but then the block index isn't updated to reflect this. This can cause btcd to fail to do things like serve cfheaders for valid blocks. To partially remedy this, when we're loading in the index, we assume that all ancestors of the current chain tip are valid, and mark them as such. At the very end, we'll flush the index to ensure the state is fully consistent. Typically this will be a noop, as only dirty elements are flushed.
- Loading branch information