-
Notifications
You must be signed in to change notification settings - Fork 942
Add assertions to clarify our assumptions about msg != NULL #1032
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
Add assertions to clarify our assumptions about msg != NULL #1032
Conversation
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.
All possible values of r->errorcode
are handled in both switch
statements, and all switch cases load some value to data
and msg
.
Also, a NULL data
is allowed by command_fail_detailed
: this is for the case where the error has no data
it can return. For PAY_IN_PROGRESS
and PAY_RHASH_ALREADY_USED
for example.
Maybe an assert(msg)
would be sufficient.
@ZmnSCPxj Thanks for your quick clarification. Updated accordingly. Please review :-) |
ACK ad3a1ee |
@ZmnSCPxj Sorry was a bit too quick. Would you mind re-reviewing? :-) |
ACK 4a9e26c |
Thanks @practicalswift for the PR and thanks @ZmnSCPxj for the super fast review round :-) |
"Allow nodes to overshoot final htlc amount and expiry (ElementsProject#1032)" Note that this also renamed `min_final_cltv_expiry` to the more-correct `min_final_cltv_expiry_delta`. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
"Allow nodes to overshoot final htlc amount and expiry (ElementsProject#1032)" Note that this also renamed `min_final_cltv_expiry` to the more-correct `min_final_cltv_expiry_delta`. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
"Allow nodes to overshoot final htlc amount and expiry (#1032)" Note that this also renamed `min_final_cltv_expiry` to the more-correct `min_final_cltv_expiry_delta`. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
"Allow nodes to overshoot final htlc amount and expiry (ElementsProject#1032)" Note that this also renamed `min_final_cltv_expiry` to the more-correct `min_final_cltv_expiry_delta`. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
"Allow nodes to overshoot final htlc amount and expiry (ElementsProject#1032)" Note that this also renamed `min_final_cltv_expiry` to the more-correct `min_final_cltv_expiry_delta`. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
"Allow nodes to overshoot final htlc amount and expiry (ElementsProject#1032)" Note that this also renamed `min_final_cltv_expiry` to the more-correct `min_final_cltv_expiry_delta`. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
"Allow nodes to overshoot final htlc amount and expiry (ElementsProject#1032)" Note that this also renamed `min_final_cltv_expiry` to the more-correct `min_final_cltv_expiry_delta`. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Avoid using uninitialized values when calling
command_fail_detailed(...)
.