-
Notifications
You must be signed in to change notification settings - Fork 38.6k
Consensus: Remove calls to error() from ContextualCheckBlock #8341
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
|
ACK e7ad8a7 |
| // witness tree. | ||
| if (block.vtx[0].wit.vtxinwit.size() != 1 || block.vtx[0].wit.vtxinwit[0].scriptWitness.stack.size() != 1 || block.vtx[0].wit.vtxinwit[0].scriptWitness.stack[0].size() != 32) { | ||
| return state.DoS(100, error("%s : invalid witness nonce size", __func__), REJECT_INVALID, "bad-witness-nonce-size", true); | ||
| return state.DoS(100, false, REJECT_INVALID, "bad-witness-nonce-size", true, strprintf("%s : invalid witness nonce size", __func__)); |
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 not sure if it's worth keeping the func but I'm not against it.
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.
Tend to agree with @jtimon. I think it was removed in other places where information was migrated to the debug message.
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.
Agree with removing. I don't think function names are very useful to most debug.log readers, and to those that are, you can just grep the source code for the message. Though perhaps we should do a combined effort of fixing it everywhere. ACK with or without func
|
ACK e7ad8a7 |
|
Needs rebase |
|
utACK (with or without func), but needs rebase. |
e7ad8a7 to
5e26165
Compare
5e26165 to
7821889
Compare
|
rebased |
…lock 7821889 Consensus: Remove calls to error() from ContextualCheckBlock (NicolasDorier)
There is only two callers of ContextualCheckBlock, and they already print errors:
https://github.com/bitcoin/bitcoin/blob/master/src/main.cpp#L3780
https://github.com/bitcoin/bitcoin/blob/master/src/main.cpp#L3689
It is using the same way as #7287 by @jtimon