@@ -274,7 +274,6 @@ pub(crate) enum HTLCSource {
274
274
/// doing a double-pass on route when we get a failure back
275
275
first_hop_htlc_msat : u64 ,
276
276
payment_id : PaymentId ,
277
- payment_secret : Option < PaymentSecret > ,
278
277
} ,
279
278
}
280
279
#[ allow( clippy:: derive_hash_xor_eq) ] // Our Hash is faithful to the data, we just don't have SecretKey::hash
@@ -285,12 +284,11 @@ impl core::hash::Hash for HTLCSource {
285
284
0u8 . hash ( hasher) ;
286
285
prev_hop_data. hash ( hasher) ;
287
286
} ,
288
- HTLCSource :: OutboundRoute { path, session_priv, payment_id, payment_secret , first_hop_htlc_msat } => {
287
+ HTLCSource :: OutboundRoute { path, session_priv, payment_id, first_hop_htlc_msat } => {
289
288
1u8 . hash ( hasher) ;
290
289
path. hash ( hasher) ;
291
290
session_priv[ ..] . hash ( hasher) ;
292
291
payment_id. hash ( hasher) ;
293
- payment_secret. hash ( hasher) ;
294
292
first_hop_htlc_msat. hash ( hasher) ;
295
293
} ,
296
294
}
@@ -305,7 +303,6 @@ impl HTLCSource {
305
303
session_priv : SecretKey :: from_slice ( & [ 1 ; 32 ] ) . unwrap ( ) ,
306
304
first_hop_htlc_msat : 0 ,
307
305
payment_id : PaymentId ( [ 2 ; 32 ] ) ,
308
- payment_secret : None ,
309
306
}
310
307
}
311
308
}
@@ -2531,7 +2528,6 @@ where
2531
2528
session_priv : session_priv. clone ( ) ,
2532
2529
first_hop_htlc_msat : htlc_msat,
2533
2530
payment_id,
2534
- payment_secret : payment_secret. clone ( ) ,
2535
2531
} , onion_packet, & self . logger ) ;
2536
2532
match break_chan_entry ! ( self , send_res, chan) {
2537
2533
Some ( monitor_update) => {
@@ -6855,13 +6851,11 @@ impl Readable for HTLCSource {
6855
6851
let mut first_hop_htlc_msat: u64 = 0 ;
6856
6852
let mut path: Option < Vec < RouteHop > > = Some ( Vec :: new ( ) ) ;
6857
6853
let mut payment_id = None ;
6858
- let mut payment_secret = None ;
6859
6854
let mut payment_params: Option < PaymentParameters > = None ;
6860
6855
read_tlv_fields ! ( reader, {
6861
6856
( 0 , session_priv, required) ,
6862
6857
( 1 , payment_id, option) ,
6863
6858
( 2 , first_hop_htlc_msat, required) ,
6864
- ( 3 , payment_secret, option) ,
6865
6859
( 4 , path, vec_type) ,
6866
6860
( 5 , payment_params, ( option: ReadableArgs , 0 ) ) ,
6867
6861
} ) ;
@@ -6884,7 +6878,6 @@ impl Readable for HTLCSource {
6884
6878
first_hop_htlc_msat,
6885
6879
path,
6886
6880
payment_id : payment_id. unwrap ( ) ,
6887
- payment_secret,
6888
6881
} )
6889
6882
}
6890
6883
1 => Ok ( HTLCSource :: PreviousHopData ( Readable :: read ( reader) ?) ) ,
@@ -6896,14 +6889,13 @@ impl Readable for HTLCSource {
6896
6889
impl Writeable for HTLCSource {
6897
6890
fn write < W : Writer > ( & self , writer : & mut W ) -> Result < ( ) , crate :: io:: Error > {
6898
6891
match self {
6899
- HTLCSource :: OutboundRoute { ref session_priv, ref first_hop_htlc_msat, ref path, payment_id, payment_secret } => {
6892
+ HTLCSource :: OutboundRoute { ref session_priv, ref first_hop_htlc_msat, ref path, payment_id } => {
6900
6893
0u8 . write ( writer) ?;
6901
6894
let payment_id_opt = Some ( payment_id) ;
6902
6895
write_tlv_fields ! ( writer, {
6903
6896
( 0 , session_priv, required) ,
6904
6897
( 1 , payment_id_opt, option) ,
6905
6898
( 2 , first_hop_htlc_msat, required) ,
6906
- ( 3 , payment_secret, option) ,
6907
6899
( 4 , * path, vec_type) ,
6908
6900
( 5 , None :: <PaymentParameters >, option) , // payment_params in LDK versions prior to 0.0.115
6909
6901
} ) ;
@@ -7553,7 +7545,7 @@ where
7553
7545
for ( _, monitor) in args. channel_monitors . iter ( ) {
7554
7546
if id_to_peer. get ( & monitor. get_funding_txo ( ) . 0 . to_channel_id ( ) ) . is_none ( ) {
7555
7547
for ( htlc_source, ( htlc, _) ) in monitor. get_pending_or_resolved_outbound_htlcs ( ) {
7556
- if let HTLCSource :: OutboundRoute { payment_id, session_priv, path, payment_secret , .. } = htlc_source {
7548
+ if let HTLCSource :: OutboundRoute { payment_id, session_priv, path, .. } = htlc_source {
7557
7549
if path. is_empty ( ) {
7558
7550
log_error ! ( args. logger, "Got an empty path for a pending payment" ) ;
7559
7551
return Err ( DecodeError :: InvalidValue ) ;
@@ -7576,7 +7568,7 @@ where
7576
7568
payment_params : None ,
7577
7569
session_privs : [ session_priv_bytes] . iter ( ) . map ( |a| * a) . collect ( ) ,
7578
7570
payment_hash : htlc. payment_hash ,
7579
- payment_secret,
7571
+ payment_secret : None , // only used for retries, and we'll never retry on startup
7580
7572
keysend_preimage : None , // only used for retries, and we'll never retry on startup
7581
7573
pending_amt_msat : path_amt,
7582
7574
pending_fee_msat : Some ( path_fee) ,
0 commit comments