Skip to content

Commit 2939649

Browse files
Remove HTLCSource::OutboundRoute::payment_params
No longer used since it is no longer used to construct PaymentPathFailed events
1 parent 753e4ce commit 2939649

File tree

2 files changed

+3
-13
lines changed

2 files changed

+3
-13
lines changed

lightning/src/ln/channel.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7118,7 +7118,6 @@ mod tests {
71187118
first_hop_htlc_msat: 548,
71197119
payment_id: PaymentId([42; 32]),
71207120
payment_secret: None,
7121-
payment_params: None,
71227121
}
71237122
});
71247123

lightning/src/ln/channelmanager.rs

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -275,11 +275,6 @@ pub(crate) enum HTLCSource {
275275
first_hop_htlc_msat: u64,
276276
payment_id: PaymentId,
277277
payment_secret: Option<PaymentSecret>,
278-
/// Note that this is now "deprecated" - we write it for forwards (and read it for
279-
/// backwards) compatibility reasons, but prefer to use the data in the
280-
/// [`super::outbound_payment`] module, which stores per-payment data once instead of in
281-
/// each HTLC.
282-
payment_params: Option<PaymentParameters>,
283278
},
284279
}
285280
#[allow(clippy::derive_hash_xor_eq)] // Our Hash is faithful to the data, we just don't have SecretKey::hash
@@ -290,14 +285,13 @@ impl core::hash::Hash for HTLCSource {
290285
0u8.hash(hasher);
291286
prev_hop_data.hash(hasher);
292287
},
293-
HTLCSource::OutboundRoute { path, session_priv, payment_id, payment_secret, first_hop_htlc_msat, payment_params } => {
288+
HTLCSource::OutboundRoute { path, session_priv, payment_id, payment_secret, first_hop_htlc_msat } => {
294289
1u8.hash(hasher);
295290
path.hash(hasher);
296291
session_priv[..].hash(hasher);
297292
payment_id.hash(hasher);
298293
payment_secret.hash(hasher);
299294
first_hop_htlc_msat.hash(hasher);
300-
payment_params.hash(hasher);
301295
},
302296
}
303297
}
@@ -312,7 +306,6 @@ impl HTLCSource {
312306
first_hop_htlc_msat: 0,
313307
payment_id: PaymentId([2; 32]),
314308
payment_secret: None,
315-
payment_params: None,
316309
}
317310
}
318311
}
@@ -2511,7 +2504,6 @@ where
25112504
first_hop_htlc_msat: htlc_msat,
25122505
payment_id,
25132506
payment_secret: payment_secret.clone(),
2514-
payment_params: payment_params.clone(),
25152507
}, onion_packet, &self.logger);
25162508
match break_chan_entry!(self, send_res, chan) {
25172509
Some(monitor_update) => {
@@ -6858,7 +6850,6 @@ impl Readable for HTLCSource {
68586850
path,
68596851
payment_id: payment_id.unwrap(),
68606852
payment_secret,
6861-
payment_params,
68626853
})
68636854
}
68646855
1 => Ok(HTLCSource::PreviousHopData(Readable::read(reader)?)),
@@ -6870,7 +6861,7 @@ impl Readable for HTLCSource {
68706861
impl Writeable for HTLCSource {
68716862
fn write<W: Writer>(&self, writer: &mut W) -> Result<(), crate::io::Error> {
68726863
match self {
6873-
HTLCSource::OutboundRoute { ref session_priv, ref first_hop_htlc_msat, ref path, payment_id, payment_secret, payment_params } => {
6864+
HTLCSource::OutboundRoute { ref session_priv, ref first_hop_htlc_msat, ref path, payment_id, payment_secret } => {
68746865
0u8.write(writer)?;
68756866
let payment_id_opt = Some(payment_id);
68766867
write_tlv_fields!(writer, {
@@ -6879,7 +6870,7 @@ impl Writeable for HTLCSource {
68796870
(2, first_hop_htlc_msat, required),
68806871
(3, payment_secret, option),
68816872
(4, *path, vec_type),
6882-
(5, payment_params, option),
6873+
(5, None::<PaymentParameters>, option), // payment_params in LDK versions prior to 0.0.115
68836874
});
68846875
}
68856876
HTLCSource::PreviousHopData(ref field) => {

0 commit comments

Comments
 (0)