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:
Rusty Russell
2018-01-21 13:21:03 +10:30
committed by Christian Decker
parent 3ccf88d6c4
commit 45665a994b

View File

@@ -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)