From 45665a994b379af31bfbda01ba5d6caf262fb804 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Sun, 21 Jan 2018 13:21:03 +1030 Subject: [PATCH] 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 --- lightningd/htlc_end.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lightningd/htlc_end.c b/lightningd/htlc_end.c index dd5939824..6de06e33f 100644 --- a/lightningd/htlc_end.c +++ b/lightningd/htlc_end.c @@ -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)