Skip to content

Commit cadea5d

Browse files
Rename outgoing_cltv_value internal var.
There is no outgoing CLTV for received HTLCs, so this new var makes more sense.
1 parent 95a5ab9 commit cadea5d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lightning/src/ln/onion_payment.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ pub(super) fn create_recv_pending_htlc_info(
122122
counterparty_skimmed_fee_msat: Option<u64>, current_height: u32, accept_mpp_keysend: bool,
123123
) -> Result<PendingHTLCInfo, InboundHTLCErr> {
124124
let (
125-
payment_data, keysend_preimage, custom_tlvs, onion_amt_msat, outgoing_cltv_value,
125+
payment_data, keysend_preimage, custom_tlvs, onion_amt_msat, onion_cltv_expiry,
126126
payment_metadata, requires_blinded_error
127127
) = match hop_data {
128128
msgs::InboundOnionPayload::Receive {
@@ -162,7 +162,7 @@ pub(super) fn create_recv_pending_htlc_info(
162162
}
163163
};
164164
// final_incorrect_cltv_expiry
165-
if outgoing_cltv_value > cltv_expiry {
165+
if onion_cltv_expiry > cltv_expiry {
166166
return Err(InboundHTLCErr {
167167
msg: "Upstream node set CLTV to less than the CLTV set by the sender",
168168
err_code: 18,
@@ -221,14 +221,14 @@ pub(super) fn create_recv_pending_htlc_info(
221221
payment_data,
222222
payment_preimage,
223223
payment_metadata,
224-
incoming_cltv_expiry: outgoing_cltv_value,
224+
incoming_cltv_expiry: onion_cltv_expiry,
225225
custom_tlvs,
226226
}
227227
} else if let Some(data) = payment_data {
228228
PendingHTLCRouting::Receive {
229229
payment_data: data,
230230
payment_metadata,
231-
incoming_cltv_expiry: outgoing_cltv_value,
231+
incoming_cltv_expiry: onion_cltv_expiry,
232232
phantom_shared_secret,
233233
custom_tlvs,
234234
requires_blinded_error,
@@ -246,7 +246,7 @@ pub(super) fn create_recv_pending_htlc_info(
246246
incoming_shared_secret: shared_secret,
247247
incoming_amt_msat: Some(amt_msat),
248248
outgoing_amt_msat: onion_amt_msat,
249-
outgoing_cltv_value,
249+
outgoing_cltv_value: onion_cltv_expiry,
250250
skimmed_fee_msat: counterparty_skimmed_fee_msat,
251251
})
252252
}

0 commit comments

Comments
 (0)