Browse Source

lightningd: don't allow zero cltv HTLCs. (#2214)

Fixes: #2077
Fixes: #2213
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
pr-2218
Rusty Russell 6 years ago
committed by Christian Decker
parent
commit
3006844f92
  1. 2
      lightningd/peer_htlcs.c

2
lightningd/peer_htlcs.c

@ -199,7 +199,7 @@ static bool check_amount(struct htlc_in *hin,
static bool check_cltv(struct htlc_in *hin,
u32 cltv_expiry, u32 outgoing_cltv_value, u32 delta)
{
if (cltv_expiry - delta >= outgoing_cltv_value)
if (delta < cltv_expiry && cltv_expiry - delta >= outgoing_cltv_value)
return true;
log_debug(hin->key.channel->log, "HTLC %"PRIu64" incorrect CLTV:"
" %u in, %u out, delta reqd %u",

Loading…
Cancel
Save