@@ -286,7 +286,6 @@ pub(crate) enum HTLCSource {
286
286
/// doing a double-pass on route when we get a failure back
287
287
first_hop_htlc_msat : u64 ,
288
288
payment_id : PaymentId ,
289
- payment_secret : Option < PaymentSecret > ,
290
289
} ,
291
290
}
292
291
#[ allow( clippy:: derive_hash_xor_eq) ] // Our Hash is faithful to the data, we just don't have SecretKey::hash
@@ -297,12 +296,11 @@ impl core::hash::Hash for HTLCSource {
297
296
0u8 . hash ( hasher) ;
298
297
prev_hop_data. hash ( hasher) ;
299
298
} ,
300
- HTLCSource :: OutboundRoute { path, session_priv, payment_id, payment_secret , first_hop_htlc_msat } => {
299
+ HTLCSource :: OutboundRoute { path, session_priv, payment_id, first_hop_htlc_msat } => {
301
300
1u8 . hash ( hasher) ;
302
301
path. hash ( hasher) ;
303
302
session_priv[ ..] . hash ( hasher) ;
304
303
payment_id. hash ( hasher) ;
305
- payment_secret. hash ( hasher) ;
306
304
first_hop_htlc_msat. hash ( hasher) ;
307
305
} ,
308
306
}
@@ -317,7 +315,6 @@ impl HTLCSource {
317
315
session_priv : SecretKey :: from_slice ( & [ 1 ; 32 ] ) . unwrap ( ) ,
318
316
first_hop_htlc_msat : 0 ,
319
317
payment_id : PaymentId ( [ 2 ; 32 ] ) ,
320
- payment_secret : None ,
321
318
}
322
319
}
323
320
}
@@ -2556,7 +2553,6 @@ where
2556
2553
session_priv : session_priv. clone ( ) ,
2557
2554
first_hop_htlc_msat : htlc_msat,
2558
2555
payment_id,
2559
- payment_secret : payment_secret. clone ( ) ,
2560
2556
} , onion_packet, & self . logger ) ;
2561
2557
match break_chan_entry ! ( self , send_res, chan) {
2562
2558
Some ( monitor_update) => {
@@ -6900,13 +6896,11 @@ impl Readable for HTLCSource {
6900
6896
let mut first_hop_htlc_msat: u64 = 0 ;
6901
6897
let mut path: Option < Vec < RouteHop > > = Some ( Vec :: new ( ) ) ;
6902
6898
let mut payment_id = None ;
6903
- let mut payment_secret = None ;
6904
6899
let mut payment_params: Option < PaymentParameters > = None ;
6905
6900
read_tlv_fields ! ( reader, {
6906
6901
( 0 , session_priv, required) ,
6907
6902
( 1 , payment_id, option) ,
6908
6903
( 2 , first_hop_htlc_msat, required) ,
6909
- ( 3 , payment_secret, option) ,
6910
6904
( 4 , path, vec_type) ,
6911
6905
( 5 , payment_params, ( option: ReadableArgs , 0 ) ) ,
6912
6906
} ) ;
@@ -6929,7 +6923,6 @@ impl Readable for HTLCSource {
6929
6923
first_hop_htlc_msat,
6930
6924
path,
6931
6925
payment_id : payment_id. unwrap ( ) ,
6932
- payment_secret,
6933
6926
} )
6934
6927
}
6935
6928
1 => Ok ( HTLCSource :: PreviousHopData ( Readable :: read ( reader) ?) ) ,
@@ -6941,14 +6934,14 @@ impl Readable for HTLCSource {
6941
6934
impl Writeable for HTLCSource {
6942
6935
fn write < W : Writer > ( & self , writer : & mut W ) -> Result < ( ) , crate :: io:: Error > {
6943
6936
match self {
6944
- HTLCSource :: OutboundRoute { ref session_priv, ref first_hop_htlc_msat, ref path, payment_id, payment_secret } => {
6937
+ HTLCSource :: OutboundRoute { ref session_priv, ref first_hop_htlc_msat, ref path, payment_id } => {
6945
6938
0u8 . write ( writer) ?;
6946
6939
let payment_id_opt = Some ( payment_id) ;
6947
6940
write_tlv_fields ! ( writer, {
6948
6941
( 0 , session_priv, required) ,
6949
6942
( 1 , payment_id_opt, option) ,
6950
6943
( 2 , first_hop_htlc_msat, required) ,
6951
- ( 3 , payment_secret , option ) ,
6944
+ // 3 was previously used to write a PaymentSecret for the payment.
6952
6945
( 4 , * path, vec_type) ,
6953
6946
( 5 , None :: <PaymentParameters >, option) , // payment_params in LDK versions prior to 0.0.115
6954
6947
} ) ;
@@ -7611,7 +7604,7 @@ where
7611
7604
for ( _, monitor) in args. channel_monitors . iter ( ) {
7612
7605
if id_to_peer. get ( & monitor. get_funding_txo ( ) . 0 . to_channel_id ( ) ) . is_none ( ) {
7613
7606
for ( htlc_source, ( htlc, _) ) in monitor. get_pending_or_resolved_outbound_htlcs ( ) {
7614
- if let HTLCSource :: OutboundRoute { payment_id, session_priv, path, payment_secret , .. } = htlc_source {
7607
+ if let HTLCSource :: OutboundRoute { payment_id, session_priv, path, .. } = htlc_source {
7615
7608
if path. is_empty ( ) {
7616
7609
log_error ! ( args. logger, "Got an empty path for a pending payment" ) ;
7617
7610
return Err ( DecodeError :: InvalidValue ) ;
@@ -7634,7 +7627,7 @@ where
7634
7627
payment_params : None ,
7635
7628
session_privs : [ session_priv_bytes] . iter ( ) . map ( |a| * a) . collect ( ) ,
7636
7629
payment_hash : htlc. payment_hash ,
7637
- payment_secret,
7630
+ payment_secret : None , // only used for retries, and we'll never retry on startup
7638
7631
keysend_preimage : None , // only used for retries, and we'll never retry on startup
7639
7632
pending_amt_msat : path_amt,
7640
7633
pending_fee_msat : Some ( path_fee) ,
0 commit comments