Browse Source

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>
ppa-0.6.1
Rusty Russell 7 years ago
committed by Christian Decker
parent
commit
45665a994b
  1. 4
      lightningd/htlc_end.c

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

Loading…
Cancel
Save