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

help: Generate checkpoint height from chainparams #19241

Merged
merged 1 commit into from
Sep 15, 2020

Conversation

luke-jr
Copy link
Member

@luke-jr luke-jr commented Jun 10, 2020

Not sure if this is worth putting in Core, but might as well until checkpoints are removed entirely.

@laanwj
Copy link
Member

laanwj commented Jun 11, 2020

ACK 6ba3f6d
re-ACK 916d359
This is preferable to hardcoding the value in the string.

@laanwj laanwj added the Docs label Jun 11, 2020
src/init.cpp Outdated Show resolved Hide resolved
@DrahtBot
Copy link
Contributor

DrahtBot commented Jul 21, 2020

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

Reviewers, 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.

@luke-jr
Copy link
Member Author

luke-jr commented Aug 19, 2020

Abstracted checkpoint access and rebased

@luke-jr luke-jr force-pushed the help_checkpoint_num branch from 6ba3f6d to 40ef5d4 Compare August 19, 2020 23:10
@sipa
Copy link
Member

sipa commented Aug 20, 2020

utACK 40ef5d4

@donaloconnor
Copy link
Contributor

utACK 40ef5d4

src/init.cpp Outdated Show resolved Hide resolved
@luke-jr luke-jr force-pushed the help_checkpoint_num branch from 40ef5d4 to 916d359 Compare August 20, 2020 18:20
@laanwj laanwj merged commit 62e3eb9 into bitcoin:master Sep 15, 2020
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Sep 15, 2020
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 */;
Copy link
Contributor

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.

@bitcoin bitcoin locked as resolved and limited conversation to collaborators Feb 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants