@@ -97,14 +97,6 @@ impl PendingOutboundPayment {
9797 _ => false ,
9898 }
9999 }
100- fn payment_parameters ( & mut self ) -> Option < & mut PaymentParameters > {
101- match self {
102- PendingOutboundPayment :: Retryable { payment_params : Some ( ref mut params) , .. } => {
103- Some ( params)
104- } ,
105- _ => None ,
106- }
107- }
108100 pub fn insert_previously_failed_scid ( & mut self , scid : u64 ) {
109101 if let PendingOutboundPayment :: Retryable { payment_params : Some ( params) , .. } = self {
110102 params. previously_failed_channels . push ( scid) ;
@@ -798,7 +790,6 @@ impl OutboundPayments {
798790 failure : events:: PathFailure :: InitialSend { err : e } ,
799791 path,
800792 short_channel_id : failed_scid,
801- retry : None ,
802793 #[ cfg( test) ]
803794 error_code : None ,
804795 #[ cfg( test) ]
@@ -1128,8 +1119,8 @@ impl OutboundPayments {
11281119 pub ( super ) fn fail_htlc < L : Deref > (
11291120 & self , source : & HTLCSource , payment_hash : & PaymentHash , onion_error : & HTLCFailReason ,
11301121 path : & Vec < RouteHop > , session_priv : & SecretKey , payment_id : & PaymentId ,
1131- payment_params : & Option < PaymentParameters > , probing_cookie_secret : [ u8 ; 32 ] ,
1132- secp_ctx : & Secp256k1 < secp256k1 :: All > , pending_events : & Mutex < Vec < events:: Event > > , logger : & L
1122+ probing_cookie_secret : [ u8 ; 32 ] , secp_ctx : & Secp256k1 < secp256k1 :: All > ,
1123+ pending_events : & Mutex < Vec < events:: Event > > , logger : & L
11331124 ) -> bool where L :: Target : Logger {
11341125 #[ cfg( test) ]
11351126 let ( network_update, short_channel_id, payment_retryable, onion_error_code, onion_error_data) = onion_error. decode_onion_failure ( secp_ctx, logger, & source) ;
@@ -1157,7 +1148,6 @@ impl OutboundPayments {
11571148
11581149 let mut full_failure_ev = None ;
11591150 let mut pending_retry_ev = false ;
1160- let mut retry = None ;
11611151 let attempts_remaining = if let hash_map:: Entry :: Occupied ( mut payment) = outbounds. entry ( * payment_id) {
11621152 if !payment. get_mut ( ) . remove ( & session_priv_bytes, Some ( & path) ) {
11631153 log_trace ! ( logger, "Received duplicative fail for HTLC with payment_hash {}" , log_bytes!( payment_hash. 0 ) ) ;
@@ -1169,27 +1159,13 @@ impl OutboundPayments {
11691159 }
11701160 let mut is_retryable_now = payment. get ( ) . is_auto_retryable_now ( ) ;
11711161 if let Some ( scid) = short_channel_id {
1162+ // TODO: If we decided to blame ourselves (or one of our channels) in
1163+ // process_onion_failure we should close that channel as it implies our
1164+ // next-hop is needlessly blaming us!
11721165 payment. get_mut ( ) . insert_previously_failed_scid ( scid) ;
11731166 }
11741167
1175- // We want to move towards only using the `PaymentParameters` in the outbound payments
1176- // map. However, for backwards-compatibility, we still need to support passing the
1177- // `PaymentParameters` data that was shoved in the HTLC (and given to us via
1178- // `payment_params`) back to the user.
1179- let path_last_hop = path. last ( ) . expect ( "Outbound payments must have had a valid path" ) ;
1180- if let Some ( params) = payment. get_mut ( ) . payment_parameters ( ) {
1181- retry = Some ( RouteParameters {
1182- payment_params : params. clone ( ) ,
1183- final_value_msat : path_last_hop. fee_msat ,
1184- } ) ;
1185- } else if let Some ( params) = payment_params {
1186- retry = Some ( RouteParameters {
1187- payment_params : params. clone ( ) ,
1188- final_value_msat : path_last_hop. fee_msat ,
1189- } ) ;
1190- }
1191-
1192- if payment_is_probe || !is_retryable_now || !payment_retryable || retry. is_none ( ) {
1168+ if payment_is_probe || !is_retryable_now || !payment_retryable {
11931169 let _ = payment. get_mut ( ) . mark_abandoned ( ) ; // we'll only Err if it's a legacy payment
11941170 is_retryable_now = false ;
11951171 }
@@ -1229,12 +1205,6 @@ impl OutboundPayments {
12291205 }
12301206 }
12311207 } else {
1232- // TODO: If we decided to blame ourselves (or one of our channels) in
1233- // process_onion_failure we should close that channel as it implies our
1234- // next-hop is needlessly blaming us!
1235- if let Some ( scid) = short_channel_id {
1236- retry. as_mut ( ) . map ( |r| r. payment_params . previously_failed_channels . push ( scid) ) ;
1237- }
12381208 // If we miss abandoning the payment above, we *must* generate an event here or else the
12391209 // payment will sit in our outbounds forever.
12401210 if attempts_remaining && !already_awaiting_retry {
@@ -1248,7 +1218,6 @@ impl OutboundPayments {
12481218 failure : events:: PathFailure :: OnPath { network_update } ,
12491219 path : path. clone ( ) ,
12501220 short_channel_id,
1251- retry,
12521221 #[ cfg( test) ]
12531222 error_code : onion_error_code,
12541223 #[ cfg( test) ]
0 commit comments