-
Notifications
You must be signed in to change notification settings - Fork 36.6k
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
help: Generate checkpoint height from chainparams #19241
Conversation
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
Abstracted checkpoint access and rebased |
6ba3f6d
to
40ef5d4
Compare
utACK 40ef5d4 |
utACK 40ef5d4 |
40ef5d4
to
916d359
Compare
916d359 help: Generate checkpoint height from chainparams (Luke Dashjr) Pull request description: Not sure if this is worth putting in Core, but might as well until checkpoints are removed entirely. ACKs for top commit: laanwj: re-ACK 916d359 Tree-SHA512: d8eb26b570ee730fdd75ca916507134db5f2f68987a911e33544b7f1c9ccfd1c76b9c9db63056971956b6daf16910f17ecfc197481c2f7b0773afdfbf7d381cf
|
||
int GetHeight() const { | ||
const auto& final_checkpoint = mapCheckpoints.rbegin(); | ||
return final_checkpoint->first /* height */; |
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 think ideally, any begin/end/rbegin/rend iterator should be tested before deferencing:
return final_checkpoint == mapCheckpoints.rend() ? 0 : final_checkpoint->first;
or similar.
Not sure if this is worth putting in Core, but might as well until checkpoints are removed entirely.