mirror of
https://github.com/aljazceru/lightning.git
synced 2026-02-07 23:24:21 +01:00
htlc_end: allow htlc_out to have 0 msatoshi.
Such an htlc is invalid, and will be failed cleanly by our channeld (which also checks that it meets the minimum amount), but it's not the master's job to check it, and in fact, it asserts if we were to try to pay or forward such a thing. Fixes: #686 Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Christian Decker
parent
3ccf88d6c4
commit
45665a994b
@@ -120,9 +120,7 @@ struct htlc_in *new_htlc_in(const tal_t *ctx,
|
||||
struct htlc_out *htlc_out_check(const struct htlc_out *hout,
|
||||
const char *abortstr)
|
||||
{
|
||||
if (hout->msatoshi == 0)
|
||||
return corrupt(hout, abortstr, "zero msatoshi");
|
||||
else if (htlc_state_owner(hout->hstate) != LOCAL)
|
||||
if (htlc_state_owner(hout->hstate) != LOCAL)
|
||||
return corrupt(hout, abortstr, "invalid state %s",
|
||||
htlc_state_name(hout->hstate));
|
||||
else if (hout->failuremsg && hout->preimage)
|
||||
|
||||
Reference in New Issue
Block a user