lightningd: don't allow zero cltv HTLCs. (#2214)
Fixes: #2077 Fixes: #2213 Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
0321d79540
commit
3006844f92
|
@ -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…
Reference in New Issue