Browse Source

Typo fix: CTLV -> CLTV.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ppa-0.6.1
Rusty Russell 8 years ago
committed by Christian Decker
parent
commit
2a28173891
  1. 2
      channeld/full_channel.c
  2. 20
      lightningd/peer_htlcs.c

2
channeld/full_channel.c

@ -819,7 +819,7 @@ bool channel_force_htlcs(struct channel *channel,
struct htlc *htlc; struct htlc *htlc;
status_trace("Restoring HTLC %zu/%zu:" status_trace("Restoring HTLC %zu/%zu:"
" id=%"PRIu64" msat=%"PRIu64" ctlv=%u" " id=%"PRIu64" msat=%"PRIu64" cltv=%u"
" payment_hash=%s", " payment_hash=%s",
i, tal_count(htlcs), i, tal_count(htlcs),
htlcs[i].id, htlcs[i].amount_msat, htlcs[i].id, htlcs[i].amount_msat,

20
lightningd/peer_htlcs.c

@ -165,7 +165,7 @@ static u8 *make_failmsg(const tal_t *ctx, u64 msatoshi,
case WIRE_FEE_INSUFFICIENT: case WIRE_FEE_INSUFFICIENT:
return towire_fee_insufficient(ctx, msatoshi, channel_update); return towire_fee_insufficient(ctx, msatoshi, channel_update);
case WIRE_INCORRECT_CLTV_EXPIRY: case WIRE_INCORRECT_CLTV_EXPIRY:
/* FIXME: ctlv! */ /* FIXME: cltv! */
return towire_incorrect_cltv_expiry(ctx, 0, channel_update); return towire_incorrect_cltv_expiry(ctx, 0, channel_update);
case WIRE_EXPIRY_TOO_SOON: case WIRE_EXPIRY_TOO_SOON:
return towire_expiry_too_soon(ctx, channel_update); return towire_expiry_too_soon(ctx, channel_update);
@ -176,7 +176,7 @@ static u8 *make_failmsg(const tal_t *ctx, u64 msatoshi,
case WIRE_FINAL_EXPIRY_TOO_SOON: case WIRE_FINAL_EXPIRY_TOO_SOON:
return towire_final_expiry_too_soon(ctx); return towire_final_expiry_too_soon(ctx);
case WIRE_FINAL_INCORRECT_CLTV_EXPIRY: case WIRE_FINAL_INCORRECT_CLTV_EXPIRY:
/* FIXME: ctlv! */ /* FIXME: cltv! */
return towire_final_incorrect_cltv_expiry(ctx, 0); return towire_final_incorrect_cltv_expiry(ctx, 0);
case WIRE_FINAL_INCORRECT_HTLC_AMOUNT: case WIRE_FINAL_INCORRECT_HTLC_AMOUNT:
return towire_final_incorrect_htlc_amount(ctx, msatoshi); return towire_final_incorrect_htlc_amount(ctx, msatoshi);
@ -268,14 +268,14 @@ static bool check_amount(struct htlc_in *hin,
* `outgoing_cltv_value` whether it is the final hop or not, to avoid * `outgoing_cltv_value` whether it is the final hop or not, to avoid
* leaking that information. * leaking that information.
*/ */
static bool check_ctlv(struct htlc_in *hin, static bool check_cltv(struct htlc_in *hin,
u32 ctlv_expiry, u32 outgoing_cltv_value, u32 delta) u32 cltv_expiry, u32 outgoing_cltv_value, u32 delta)
{ {
if (ctlv_expiry - delta == outgoing_cltv_value) if (cltv_expiry - delta == outgoing_cltv_value)
return true; return true;
log_debug(hin->key.peer->ld->log, "HTLC %"PRIu64" incorrect CLTV:" log_debug(hin->key.peer->ld->log, "HTLC %"PRIu64" incorrect CLTV:"
" %u in, %u out, delta reqd %u", " %u in, %u out, delta reqd %u",
hin->key.id, ctlv_expiry, outgoing_cltv_value, delta); hin->key.id, cltv_expiry, outgoing_cltv_value, delta);
return false; return false;
} }
@ -333,14 +333,14 @@ static void handle_localpay(struct htlc_in *hin,
/* BOLT #4: /* BOLT #4:
* *
* If the `outgoing_cltv_value` does not match the `ctlv_expiry` of * If the `outgoing_cltv_value` does not match the `cltv_expiry` of
* the HTLC at the final hop: * the HTLC at the final hop:
* *
* 1. type: 18 (`final_incorrect_cltv_expiry`) * 1. type: 18 (`final_incorrect_cltv_expiry`)
* 2. data: * 2. data:
* * [`4`:`cltv_expiry`] * * [`4`:`cltv_expiry`]
*/ */
if (!check_ctlv(hin, cltv_expiry, outgoing_cltv_value, 0)) { if (!check_cltv(hin, cltv_expiry, outgoing_cltv_value, 0)) {
failcode = WIRE_FINAL_INCORRECT_CLTV_EXPIRY; failcode = WIRE_FINAL_INCORRECT_CLTV_EXPIRY;
goto fail; goto fail;
} }
@ -529,7 +529,7 @@ static void forward_htlc(struct htlc_in *hin,
goto fail; goto fail;
} }
if (!check_ctlv(hin, cltv_expiry, outgoing_cltv_value, if (!check_cltv(hin, cltv_expiry, outgoing_cltv_value,
ld->config.min_htlc_expiry)) { ld->config.min_htlc_expiry)) {
failcode = WIRE_INCORRECT_CLTV_EXPIRY; failcode = WIRE_INCORRECT_CLTV_EXPIRY;
goto fail; goto fail;
@ -537,7 +537,7 @@ static void forward_htlc(struct htlc_in *hin,
/* BOLT #4: /* BOLT #4:
* *
* If the ctlv-expiry is too near, we tell them the the current channel * If the cltv-expiry is too near, we tell them the the current channel
* setting for the outgoing channel: * setting for the outgoing channel:
* 1. type: UPDATE|14 (`expiry_too_soon`) * 1. type: UPDATE|14 (`expiry_too_soon`)
* 2. data: * 2. data:

Loading…
Cancel
Save