-
Notifications
You must be signed in to change notification settings - Fork 37.9k
[docs] fix findFork comment #15659
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
[docs] fix findFork comment #15659
Conversation
"is or has an ancestor" doesn't make much sense to me. The function is returning the highest common point, if the block is on the chain, that's obviously itself. The comment in chain.h is correct and I think not confusing: Find the last common block between this chain and a block index entry. |
Similarly, the following comment is true only if the locator is not created by a block on the active chain.
|
@r8921039, I wrote these comments and I can see how they are confusing. I wrote "ancestor" here when I really meant "ancestor-or-self" because it seemed less awkward (similar to how people write ⊂ instead of ⊆ in math for convenience, even though it can be less clear if you don't know the context). I think "highest block on the chain that is or has an ancestor of the specified block" is hard to parse, though. Maybe it would be better to change these comments to:
|
@ryanofsky Thank you very much for your response and suggestions. The PR is updated accordingly. |
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.
utACK b837d66
Please squash your commits according to https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#squashing-commits |
… when the specified block is on the active chain update with suggested comment text from the reviewers
b837d66
to
c968780
Compare
@MarcoFalke Yes sir, done as instructed. |
utACK c968780, however comment could be shorter. |
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.
utACK c968780. Only change since last review is squash
Would someone be willing to give a bit more love to this PR... Thanks. |
This could just be merged I think. Documentation update with no change in meaning. |
@MarcoFalke Do we need more utACK to proceed? If you think so, I will try asking on IRC. Thanks. |
c968780 [docs] fix comment: the return value of findFork is _not_ an ancestor when the specified block is on the active chain (r8921039) Pull request description: The return value of findFork is an ancestor of the specified block only when specified block is _not_ on the active chain. When it is on the active chain, the return value is the specified block itself, not an ancestor of it. ACKs for commit c96878: promag: utACK c968780, however comment could be shorter. ryanofsky: utACK c968780. Only change since last review is squash Tree-SHA512: bb05d734059898784c4a59b5b0344719eb4dfb2d49a0f7f705fcb2eb630702e66be81c01299185faf0c219fa9f9aa64cbdf6d5f91e0b3dce0ff420909a454a18
Thanks a lot guys! :) |
The return value of findFork is an ancestor of the specified block only when specified block is not on the active chain. When it is on the active chain, the return value is the specified block itself, not an ancestor of it.