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.
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
fix: find common header between the header chain and the current body chain #3033
fix: find common header between the header chain and the current body chain #3033
Changes from 1 commit
c961898
54fc220
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets rename this usage of current to make it clearer that we want to check for headers in our db based on
body_head
.This is a 2 step process.
head
(head of the full block chain)head
then its an errorhead
then its an errorhead
until we find a header that "is on current chain"header_head
back to this fork pointThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I put some of yours comments to the source code comments, and renamed the 2nd
current
.pls let me whether it's better now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see we are redefining current in this PR here, but I don't think we need to do this. Earlier this isbody_head
and now this is redefined based onheader_head
.Edit: We do need to do this, but I think we should make it explicit in terms of naming -
current
is too ambiguous, particularly when we reuse it later on for a different purpose.I think it should consistently be based on a header from the db starting atheader_head
and working back until we find one that also refers to a full block in our db.Ok I think I get it now. Let me think through what you are doing here a bit more.