Backport Bitcoin PR#8969: Decouple peer-processing-logic from block-connection-logic (#2)#1558
Merged
UdjinM6 merged 5 commits intodashpay:v0.12.2.xfrom Aug 1, 2017
Merged
Conversation
UnloadBlockIndex is only used during init if we end up reindexing to clear our block state so that we can start over. However, at that time no connections have been brought up as CConnman hasn't been started yet, so all of the network processing state logic is empty when its called. Additionally, the initialization of the recentRejects set is moved to InitPeerLogic.
This will result in many more calls to CheckBlockIndex when connecting a list of headers (eg in ::HEADERS messages processing) but its only enabled in debug mode, and that should mostly just be during IBD, so it should be OK.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is backport of Bitcoin PR bitcoin#8969.
This is another PR needed in preparation for
main.{h,cpp}split.Please ignore bitcoin#8968 mentioned in the original PR description, it seems to be irrelevant because it changes part of code that is not present in Dash.
The original PR description follows.
This is the second part of a series of about 20 commits which split main.cpp into two - peer processing logic and blockchain/mempool/UTXO logic, after bitcoin#8865.
This set focuses on random bits of interconnection left over after bitcoin#8865 (the largest diff is actually bitcoin#8968, which this is based on just to avoid needless confliction).
I haven't significantly tested this as my normal test machine is largely unavailable atm, but most of the changes here are pretty straight-forward.