channel: Use min_cltv_expiry in the channel announcements

So far we were always using the deadline in the announcements, that's
obviously not good, so this introduces the parameter as per spec.

Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
Christian Decker
2017-09-06 13:47:29 -07:00
committed by Rusty Russell
parent a44f893838
commit 641a3b64cf
3 changed files with 4 additions and 4 deletions

View File

@@ -2034,7 +2034,7 @@ static bool peer_start_channeld(struct peer *peer,
&peer->ld->id,
&peer->id,
time_to_msec(cfg->commit_time),
cfg->deadline_blocks,
cfg->min_htlc_expiry,
peer->last_was_revoke,
peer->last_sent_commit,
peer->next_index[LOCAL],

View File

@@ -514,7 +514,7 @@ static void forward_htlc(struct htlc_in *hin,
}
if (!check_ctlv(hin, cltv_expiry, outgoing_cltv_value,
ld->config.deadline_blocks)) {
ld->config.min_htlc_expiry)) {
failcode = WIRE_INCORRECT_CLTV_EXPIRY;
goto fail;
}

View File

@@ -689,11 +689,11 @@ class LightningDTests(BaseLightningDTests):
baseroute = [ { 'msatoshi' : amt + fee,
'id' : l2.info['id'],
'delay' : 10,
'delay' : 12,
'channel' : chanid1 },
{ 'msatoshi' : amt,
'id' : l3.info['id'],
'delay' : 5,
'delay' : 6,
'channel' : chanid2 } ]
# Unknown other peer