]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Rename OutboundOnionPayload::Receive::outgoing_cltv_value.
authorValentine Wallace <vwallace@protonmail.com>
Wed, 13 Dec 2023 22:18:56 +0000 (17:18 -0500)
committerValentine Wallace <vwallace@protonmail.com>
Wed, 10 Jan 2024 15:56:24 +0000 (10:56 -0500)
There is no outgoing HTLC for received HTLCs, so rename to be more accurate.

lightning/src/ln/msgs.rs
lightning/src/ln/onion_utils.rs

index d9b5cda4bcbc8e9f9b820b57139e32d4827a2c05..c0d19df53c4bdb65da8013ca5cb765f8ba6d9042 100644 (file)
@@ -1739,7 +1739,7 @@ mod fuzzy_internal_msgs {
                        keysend_preimage: Option<PaymentPreimage>,
                        custom_tlvs: Vec<(u64, Vec<u8>)>,
                        amt_msat: u64,
-                       outgoing_cltv_value: u32,
+                       cltv_expiry_height: u32,
                },
                BlindedForward {
                        encrypted_tlvs: Vec<u8>,
@@ -2289,8 +2289,8 @@ impl Writeable for OutboundOnionPayload {
                                });
                        },
                        Self::Receive {
-                               ref payment_data, ref payment_metadata, ref keysend_preimage, amt_msat,
-                               outgoing_cltv_value, ref custom_tlvs,
+                               ref payment_data, ref payment_metadata, ref keysend_preimage, amt_msat, cltv_expiry_height,
+                               ref custom_tlvs,
                        } => {
                                // We need to update [`ln::outbound_payment::RecipientOnionFields::with_custom_tlvs`]
                                // to reject any reserved types in the experimental range if new ones are ever
@@ -2300,7 +2300,7 @@ impl Writeable for OutboundOnionPayload {
                                custom_tlvs.sort_unstable_by_key(|(typ, _)| *typ);
                                _encode_varint_length_prefixed_tlv!(w, {
                                        (2, HighZeroBytesDroppedBigSize(*amt_msat), required),
-                                       (4, HighZeroBytesDroppedBigSize(*outgoing_cltv_value), required),
+                                       (4, HighZeroBytesDroppedBigSize(*cltv_expiry_height), required),
                                        (8, payment_data, option),
                                        (16, payment_metadata.as_ref().map(|m| WithoutLength(m)), option)
                                }, custom_tlvs.iter());
@@ -4020,7 +4020,7 @@ mod tests {
                        payment_metadata: None,
                        keysend_preimage: None,
                        amt_msat: 0x0badf00d01020304,
-                       outgoing_cltv_value: 0xffffffff,
+                       cltv_expiry_height: 0xffffffff,
                        custom_tlvs: vec![],
                };
                let encoded_value = outbound_msg.encode();
@@ -4048,7 +4048,7 @@ mod tests {
                        payment_metadata: None,
                        keysend_preimage: None,
                        amt_msat: 0x0badf00d01020304,
-                       outgoing_cltv_value: 0xffffffff,
+                       cltv_expiry_height: 0xffffffff,
                        custom_tlvs: vec![],
                };
                let encoded_value = outbound_msg.encode();
@@ -4088,7 +4088,7 @@ mod tests {
                        keysend_preimage: None,
                        custom_tlvs: bad_type_range_tlvs,
                        amt_msat: 0x0badf00d01020304,
-                       outgoing_cltv_value: 0xffffffff,
+                       cltv_expiry_height: 0xffffffff,
                };
                let encoded_value = msg.encode();
                let node_signer = test_utils::TestKeysInterface::new(&[42; 32], Network::Testnet);
@@ -4120,7 +4120,7 @@ mod tests {
                        keysend_preimage: None,
                        custom_tlvs: expected_custom_tlvs.clone(),
                        amt_msat: 0x0badf00d01020304,
-                       outgoing_cltv_value: 0xffffffff,
+                       cltv_expiry_height: 0xffffffff,
                };
                let encoded_value = msg.encode();
                let target_value = <Vec<u8>>::from_hex("2e02080badf00d010203040404ffffffffff0000000146c6616b021234ff0000000146c6616f084242424242424242").unwrap();
index 99e3e965a9a9aab167928198db79b82054c98066..840ada4d137108e67f74281dc9c1f24ed4e69c41 100644 (file)
@@ -215,7 +215,7 @@ pub(super) fn build_onion_payloads(path: &Path, total_msat: u64, mut recipient_o
                                        keysend_preimage: *keysend_preimage,
                                        custom_tlvs: recipient_onion.custom_tlvs.clone(),
                                        amt_msat: value_msat,
-                                       outgoing_cltv_value: cltv,
+                                       cltv_expiry_height: cltv,
                                });
                        }
                } else {