Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport Bitcoin PR#8969: Decouple peer-processing-logic from block-connection-logic (#2) #1558

Merged
merged 5 commits into from
Aug 1, 2017

Conversation

OlegGirko
Copy link

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.

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.
Copy link

@tgflynn tgflynn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

Copy link

@UdjinM6 UdjinM6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

@UdjinM6 UdjinM6 added this to the 12.2 milestone Aug 1, 2017
@UdjinM6 UdjinM6 merged commit e7e106e into dashpay:v0.12.2.x Aug 1, 2017
@OlegGirko OlegGirko deleted the bc-pr-8969 branch August 1, 2017 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants