Skip to content

Commit 4547cab

Browse files
fixup! Add CounterpartyForwardingInfo field to channel.
1 parent 84836d5 commit 4547cab

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

lightning/src/ln/channel.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,8 +288,9 @@ pub struct CounterpartyForwardingInfo {
288288
pub fee_base_msat: u32,
289289
/// Amount in millionths of a satoshi the channel will charge per transferred satoshi.
290290
pub fee_proportional_millionths: u32,
291-
/// The number of blocks we'll add to an outgoing HTLC's cltv_expiry before forwarding.
292-
/// See `msgs::ChannelUpdate`'s `cltv_expiry_delta` for more details.
291+
/// The minimum difference in cltv_expiry between an ingoing HTLC and its outgoing counterpart,
292+
/// such that the outgoing HTLC is forwardable to this counterparty. See `msgs::ChannelUpdate`'s
293+
/// `cltv_expiry_delta` for more details.
293294
pub cltv_expiry_delta: u16,
294295
}
295296

lightning/src/ln/msgs.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -544,11 +544,13 @@ pub struct UnsignedChannelUpdate {
544544
/// Channel flags
545545
pub flags: u8,
546546
/// The number of blocks such that if:
547-
/// `htlc.cltv_expiry - current_block_height <= cltv_expiry_delta`
548-
/// then we need to fail the HTLC backwards. When forwarding an HTLC, cltv_expiry_delta is used to
549-
/// calculate the outgoing HTLC's cltv_expiry value -- so, if an incoming HTLC comes in with a
547+
/// `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
548+
/// then we need to fail the HTLC backwards. When forwarding an HTLC, cltv_expiry_delta determines
549+
/// the outgoing HTLC's minimum cltv_expiry value -- so, if an incoming HTLC comes in with a
550550
/// cltv_expiry of 100000, and the node we're forwarding to has a cltv_expiry_delta value of 10,
551-
/// then we'll set the outgoing HTLC's cltv_expiry value to 100010.
551+
/// then we'll check that the outgoing HTLC's cltv_expiry value is at least 100010 before
552+
/// forwarding. Note that the HTLC sender is the one who originally sets this value when
553+
/// constructing the route.
552554
pub cltv_expiry_delta: u16,
553555
/// The minimum HTLC size incoming to sender, in milli-satoshi
554556
pub htlc_minimum_msat: u64,

0 commit comments

Comments
 (0)