@@ -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) ; 
@@ -790,7 +782,6 @@ impl OutboundPayments {
790782					failure :  events:: PathFailure :: InitialSend  {  err :  e } , 
791783					path, 
792784					short_channel_id :  failed_scid, 
793- 					retry :  None , 
794785					#[ cfg( test) ]  
795786					error_code :  None , 
796787					#[ cfg( test) ]  
@@ -1120,8 +1111,8 @@ impl OutboundPayments {
11201111	pub ( super )  fn  fail_htlc < L :  Deref > ( 
11211112		& self ,  source :  & HTLCSource ,  payment_hash :  & PaymentHash ,  onion_error :  & HTLCFailReason , 
11221113		path :  & Vec < RouteHop > ,  session_priv :  & SecretKey ,  payment_id :  & PaymentId , 
1123- 		payment_params :   & Option < PaymentParameters > ,   probing_cookie_secret :  [ u8 ;  32 ] , 
1124- 		secp_ctx :   & Secp256k1 < secp256k1 :: All > ,   pending_events :  & Mutex < Vec < events:: Event > > ,  logger :  & L 
1114+ 		probing_cookie_secret :  [ u8 ;  32 ] ,   secp_ctx :   & Secp256k1 < secp256k1 :: All > , 
1115+ 		pending_events :  & Mutex < Vec < events:: Event > > ,  logger :  & L 
11251116	)  -> bool  where  L :: Target :  Logger  { 
11261117		#[ cfg( test) ]  
11271118		let  ( network_update,  short_channel_id,  payment_retryable,  onion_error_code,  onion_error_data)  = onion_error. decode_onion_failure ( secp_ctx,  logger,  & source) ; 
@@ -1149,7 +1140,6 @@ impl OutboundPayments {
11491140
11501141		let  mut  full_failure_ev = None ; 
11511142		let  mut  pending_retry_ev = false ; 
1152- 		let  mut  retry = None ; 
11531143		let  attempts_remaining = if  let  hash_map:: Entry :: Occupied ( mut  payment)  = outbounds. entry ( * payment_id)  { 
11541144			if  !payment. get_mut ( ) . remove ( & session_priv_bytes,  Some ( & path) )  { 
11551145				log_trace ! ( logger,  "Received duplicative fail for HTLC with payment_hash {}" ,  log_bytes!( payment_hash. 0 ) ) ; 
@@ -1161,27 +1151,13 @@ impl OutboundPayments {
11611151			} 
11621152			let  mut  is_retryable_now = payment. get ( ) . is_auto_retryable_now ( ) ; 
11631153			if  let  Some ( scid)  = short_channel_id { 
1154+ 				// TODO: If we decided to blame ourselves (or one of our channels) in 
1155+ 				// process_onion_failure we should close that channel as it implies our 
1156+ 				// next-hop is needlessly blaming us! 
11641157				payment. get_mut ( ) . insert_previously_failed_scid ( scid) ; 
11651158			} 
11661159
1167- 			// We want to move towards only using the `PaymentParameters` in the outbound payments 
1168- 			// map. However, for backwards-compatibility, we still need to support passing the 
1169- 			// `PaymentParameters` data that was shoved in the HTLC (and given to us via 
1170- 			// `payment_params`) back to the user. 
1171- 			let  path_last_hop = path. last ( ) . expect ( "Outbound payments must have had a valid path" ) ; 
1172- 			if  let  Some ( params)  = payment. get_mut ( ) . payment_parameters ( )  { 
1173- 				retry = Some ( RouteParameters  { 
1174- 					payment_params :  params. clone ( ) , 
1175- 					final_value_msat :  path_last_hop. fee_msat , 
1176- 				} ) ; 
1177- 			}  else  if  let  Some ( params)  = payment_params { 
1178- 				retry = Some ( RouteParameters  { 
1179- 					payment_params :  params. clone ( ) , 
1180- 					final_value_msat :  path_last_hop. fee_msat , 
1181- 				} ) ; 
1182- 			} 
1183- 
1184- 			if  payment_is_probe || !is_retryable_now || !payment_retryable || retry. is_none ( )  { 
1160+ 			if  payment_is_probe || !is_retryable_now || !payment_retryable { 
11851161				let  _ = payment. get_mut ( ) . mark_abandoned ( ) ;  // we'll only Err if it's a legacy payment 
11861162				is_retryable_now = false ; 
11871163			} 
@@ -1221,12 +1197,6 @@ impl OutboundPayments {
12211197					} 
12221198				} 
12231199			}  else  { 
1224- 				// TODO: If we decided to blame ourselves (or one of our channels) in 
1225- 				// process_onion_failure we should close that channel as it implies our 
1226- 				// next-hop is needlessly blaming us! 
1227- 				if  let  Some ( scid)  = short_channel_id { 
1228- 					retry. as_mut ( ) . map ( |r| r. payment_params . previously_failed_channels . push ( scid) ) ; 
1229- 				} 
12301200				// If we miss abandoning the payment above, we *must* generate an event here or else the 
12311201				// payment will sit in our outbounds forever. 
12321202				if  attempts_remaining && !already_awaiting_retry { 
@@ -1240,7 +1210,6 @@ impl OutboundPayments {
12401210					failure :  events:: PathFailure :: OnPath  {  network_update } , 
12411211					path :  path. clone ( ) , 
12421212					short_channel_id, 
1243- 					retry, 
12441213					#[ cfg( test) ]  
12451214					error_code :  onion_error_code, 
12461215					#[ cfg( test) ]  
0 commit comments