0.18: Granular invalidateblock and RewindBlockIndex #15552
This lets us simplify the iteration to just walking back in the chain, rather than looping over all of mapBlockIndex.
laanwj added a commit that referenced this issue
Mar 7, 2019
519b0bc Make last disconnected block BLOCK_FAILED_VALID, even when aborted (Pieter Wuille) 8d22041 Optimization: don't add txn back to mempool after 10 invalidates (Pieter Wuille) 9ce9c37 Prevent callback overruns in InvalidateBlock and RewindBlockIndex (Pieter Wuille) 9bb32eb Release cs_main during InvalidateBlock iterations (Pieter Wuille) 9b1ff5c Call InvalidateBlock without cs_main held (Pieter Wuille) 241b2c7 Make RewindBlockIndex interruptible (Pieter Wuille) 880ce7d Call RewindBlockIndex without cs_main held (Pieter Wuille) 436f7d7 Release cs_main during RewindBlockIndex operation (Pieter Wuille) 1d34287 Merge the disconnection and erasing loops in RewindBlockIndex (Pieter Wuille) 32b2696 Move erasure of non-active blocks to a separate loop in RewindBlockIndex (Pieter Wuille) 9d6dcc5 Abstract EraseBlockData out of RewindBlockIndex (Pieter Wuille) Pull request description: Same repo and branch like "Granular invalidateblock and RewindBlockIndex #15402 ", can be merged as is. This saves us all the cherry-picks and review of the backport cherry-picks. Tree-SHA512: 20c27c5f807c3d85e0072f9e2cdefad4ad7d329d6b26658a00844d5fcf0ed729059daf765e04e6382db2b5915117b15949cd4989d864917ab105c92e2e5e9986
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments.