-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Bugfix: Don't check the genesis block header before accepting it #6299
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
Conversation
src/main.cpp
Outdated
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.
Indentation missing
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.
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'd prefer those merge conflicts to stay merge conflicts, as it forces you to understand if that additional check matters for your merge.
What can I say, I once fixed a bug where a lack of indentation of a newly added bit of code lead to a mistake that could have potentially played a part of getting someone killed, so... :/
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'm happy to indent if people think it's better.
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.
Yes, that is still the plan at some point, although I'd say it's very low priority.
Reducing the diff is generally a good reason, but not enough to deviate this much from the coding style IMO. This makes the control flow harder to interpret in an important function.
|
Can you please cherry-pick #6298 into this, to see if the reindex test passes in travis. |
|
Updated with the correct indentation (bigger diff). |
|
utACK |
|
Btw, for the sake of easier review, you can always do a diff that ignores whitespace via To see that at github, just append ?w=1 to the url: https://github.com/bitcoin/bitcoin/pull/6299/files?w=1 |
This fixes an error triggered when running with -reindex after bitcoin#5975
This test finishes very quickly, so it should be part of the default set of tests in rpc-tests.
|
Needed rebase. |
|
Tested ACK |
|
There's an alternative solution to the bug in #6230. |
|
ACK |
Bitcoin 0.12 RPC PRs 1 Cherry-picked from the following upstream PRs: - bitcoin/bitcoin#6266 - bitcoin/bitcoin#6257 - bitcoin/bitcoin#6271 - bitcoin/bitcoin#6158 - bitcoin/bitcoin#6307 - bitcoin/bitcoin#6290 - bitcoin/bitcoin#6262 - bitcoin/bitcoin#6088 - bitcoin/bitcoin#6339 - bitcoin/bitcoin#6299 (partial, remainder in #2099) - bitcoin/bitcoin#6350 - bitcoin/bitcoin#6247 - bitcoin/bitcoin#6362 - bitcoin/bitcoin#5486 - bitcoin/bitcoin#6417 - bitcoin/bitcoin#6398 (partial, remainder was included in #1950) - bitcoin/bitcoin#6444 - bitcoin/bitcoin#6456 (partial, remainder was included in #2082) - bitcoin/bitcoin#6380 - bitcoin/bitcoin#6970 Part of #2074.
This should fix an error that was introduced in #5975 , thanks @sdaftuar for reporting the error.
I will work on a more elegant solution: the genesis block should never be checked at all; it is valid by definition. But it seems that will be more work than I first thought so let's just fix the bug first.