Skip to content

Commit e9bd591

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

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
@@ -7101,7 +7101,6 @@ mod tests {
71017101
first_hop_htlc_msat: 548,
71027102
payment_id: PaymentId([42; 32]),
71037103
payment_secret: None,
7104-
payment_params: None,
71057104
}
71067105
});
71077106

lightning/src/ln/channelmanager.rs

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -247,11 +247,6 @@ pub(crate) enum HTLCSource {
247247
first_hop_htlc_msat: u64,
248248
payment_id: PaymentId,
249249
payment_secret: Option<PaymentSecret>,
250-
/// Note that this is now "deprecated" - we write it for forwards (and read it for
251-
/// backwards) compatibility reasons, but prefer to use the data in the
252-
/// [`super::outbound_payment`] module, which stores per-payment data once instead of in
253-
/// each HTLC.
254-
payment_params: Option<PaymentParameters>,
255250
},
256251
}
257252
#[allow(clippy::derive_hash_xor_eq)] // Our Hash is faithful to the data, we just don't have SecretKey::hash
@@ -262,14 +257,13 @@ impl core::hash::Hash for HTLCSource {
262257
0u8.hash(hasher);
263258
prev_hop_data.hash(hasher);
264259
},
265-
HTLCSource::OutboundRoute { path, session_priv, payment_id, payment_secret, first_hop_htlc_msat, payment_params } => {
260+
HTLCSource::OutboundRoute { path, session_priv, payment_id, payment_secret, first_hop_htlc_msat } => {
266261
1u8.hash(hasher);
267262
path.hash(hasher);
268263
session_priv[..].hash(hasher);
269264
payment_id.hash(hasher);
270265
payment_secret.hash(hasher);
271266
first_hop_htlc_msat.hash(hasher);
272-
payment_params.hash(hasher);
273267
},
274268
}
275269
}
@@ -284,7 +278,6 @@ impl HTLCSource {
284278
first_hop_htlc_msat: 0,
285279
payment_id: PaymentId([2; 32]),
286280
payment_secret: None,
287-
payment_params: None,
288281
}
289282
}
290283
}
@@ -2459,7 +2452,6 @@ where
24592452
first_hop_htlc_msat: htlc_msat,
24602453
payment_id,
24612454
payment_secret: payment_secret.clone(),
2462-
payment_params: payment_params.clone(),
24632455
}, onion_packet, &self.logger);
24642456
match break_chan_entry!(self, send_res, chan) {
24652457
Some(monitor_update) => {
@@ -6806,7 +6798,6 @@ impl Readable for HTLCSource {
68066798
path,
68076799
payment_id: payment_id.unwrap(),
68086800
payment_secret,
6809-
payment_params,
68106801
})
68116802
}
68126803
1 => Ok(HTLCSource::PreviousHopData(Readable::read(reader)?)),
@@ -6818,7 +6809,7 @@ impl Readable for HTLCSource {
68186809
impl Writeable for HTLCSource {
68196810
fn write<W: Writer>(&self, writer: &mut W) -> Result<(), crate::io::Error> {
68206811
match self {
6821-
HTLCSource::OutboundRoute { ref session_priv, ref first_hop_htlc_msat, ref path, payment_id, payment_secret, payment_params } => {
6812+
HTLCSource::OutboundRoute { ref session_priv, ref first_hop_htlc_msat, ref path, payment_id, payment_secret } => {
68226813
0u8.write(writer)?;
68236814
let payment_id_opt = Some(payment_id);
68246815
write_tlv_fields!(writer, {
@@ -6827,7 +6818,7 @@ impl Writeable for HTLCSource {
68276818
(2, first_hop_htlc_msat, required),
68286819
(3, payment_secret, option),
68296820
(4, *path, vec_type),
6830-
(5, payment_params, option),
6821+
(5, None::<PaymentParameters>, option), // payment_params in LDK versions prior to 0.0.115
68316822
});
68326823
}
68336824
HTLCSource::PreviousHopData(ref field) => {

0 commit comments

Comments
 (0)