Skip to content

Conversation

@jtimon
Copy link
Contributor

@jtimon jtimon commented Jun 17, 2015

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.

src/main.cpp Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation missing

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, I want to avoid indenting the whole block to reduce the diff and potential for merge conflicts.
After all, at some point we will start running clang-format project wise right before forking for major releases. Is that still the plan @laanwj @sipa ?

Copy link
Contributor

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... :/

Copy link
Contributor Author

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.

Copy link
Member

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.

@laanwj laanwj added the Bug label Jun 17, 2015
@laanwj
Copy link
Member

laanwj commented Jun 17, 2015

Can you please cherry-pick #6298 into this, to see if the reindex test passes in travis.

@jtimon
Copy link
Contributor Author

jtimon commented Jun 17, 2015

@laanwj Incorporated #6298

@jtimon
Copy link
Contributor Author

jtimon commented Jun 18, 2015

Updated with the correct indentation (bigger diff).

@laanwj
Copy link
Member

laanwj commented Jun 18, 2015

utACK

@theuni
Copy link
Member

theuni commented Jun 19, 2015

Btw, for the sake of easier review, you can always do a diff that ignores whitespace via git diff -w.

To see that at github, just append ?w=1 to the url: https://github.com/bitcoin/bitcoin/pull/6299/files?w=1

jtimon and others added 2 commits June 21, 2015 01:24
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.
@jtimon
Copy link
Contributor Author

jtimon commented Jun 20, 2015

Needed rebase.
@theuni Thanks, that's useful.

@sdaftuar
Copy link
Member

Tested ACK

@jtimon
Copy link
Contributor Author

jtimon commented Jun 26, 2015

There's an alternative solution to the bug in #6230.

@laanwj laanwj merged commit 4f40716 into bitcoin:master Jun 26, 2015
laanwj added a commit that referenced this pull request Jun 26, 2015
4f40716 test: Move reindex test to standard tests (Wladimir J. van der Laan)
36c97b4 Bugfix: Don't check the genesis block header before accepting it (Jorge Timón)
@laanwj
Copy link
Member

laanwj commented Jun 26, 2015

ACK

@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
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.

5 participants