@@ -796,11 +796,11 @@ impl OutboundPayments {
796796 {
797797 match err {
798798 PaymentSendFailure :: AllFailedResendSafe ( errs) => {
799- Self :: push_path_failed_evs_and_scids ( payment_id, payment_hash, & mut route_params, route. paths , errs. into_iter ( ) . map ( |e| Err ( e) ) , pending_events) ;
799+ Self :: push_path_failed_evs_and_scids ( payment_id, payment_hash, & mut route_params, route. paths , errs. into_iter ( ) . map ( |e| Err ( e) ) , logger , pending_events) ;
800800 self . retry_payment_internal ( payment_hash, payment_id, route_params, router, first_hops, inflight_htlcs, entropy_source, node_signer, best_block_height, logger, pending_events, send_payment_along_path) ;
801801 } ,
802802 PaymentSendFailure :: PartialFailure { failed_paths_retry : Some ( mut retry) , results, .. } => {
803- Self :: push_path_failed_evs_and_scids ( payment_id, payment_hash, & mut retry, route. paths , results. into_iter ( ) , pending_events) ;
803+ Self :: push_path_failed_evs_and_scids ( payment_id, payment_hash, & mut retry, route. paths , results. into_iter ( ) , logger , pending_events) ;
804804 // Some paths were sent, even if we failed to send the full MPP value our recipient may
805805 // misbehave and claim the funds, at which point we have to consider the payment sent, so
806806 // return `Ok()` here, ignoring any retry errors.
@@ -813,7 +813,7 @@ impl OutboundPayments {
813813 } ,
814814 PaymentSendFailure :: PathParameterError ( results) => {
815815 log_error ! ( logger, "Failed to send to route due to parameter error in a single path. Your router is buggy" ) ;
816- Self :: push_path_failed_evs_and_scids ( payment_id, payment_hash, & mut route_params, route. paths , results. into_iter ( ) , pending_events) ;
816+ Self :: push_path_failed_evs_and_scids ( payment_id, payment_hash, & mut route_params, route. paths , results. into_iter ( ) , logger , pending_events) ;
817817 self . abandon_payment ( payment_id, PaymentFailureReason :: UnexpectedError , pending_events) ;
818818 } ,
819819 PaymentSendFailure :: ParameterError ( e) => {
@@ -824,14 +824,15 @@ impl OutboundPayments {
824824 }
825825 }
826826
827- fn push_path_failed_evs_and_scids < I : ExactSizeIterator + Iterator < Item = Result < ( ) , APIError > > > (
827+ fn push_path_failed_evs_and_scids < I : ExactSizeIterator + Iterator < Item = Result < ( ) , APIError > > , L : Deref > (
828828 payment_id : PaymentId , payment_hash : PaymentHash , route_params : & mut RouteParameters ,
829- paths : Vec < Vec < RouteHop > > , path_results : I , pending_events : & Mutex < Vec < events:: Event > >
830- ) {
829+ paths : Vec < Vec < RouteHop > > , path_results : I , logger : & L , pending_events : & Mutex < Vec < events:: Event > >
830+ ) where L :: Target : Logger {
831831 let mut events = pending_events. lock ( ) . unwrap ( ) ;
832832 debug_assert_eq ! ( paths. len( ) , path_results. len( ) ) ;
833833 for ( path, path_res) in paths. into_iter ( ) . zip ( path_results) {
834834 if let Err ( e) = path_res {
835+ log_error ! ( logger, "Failed to send along path due to error: {:?}" , e) ;
835836 if let APIError :: MonitorUpdateInProgress = e { continue }
836837 let mut failed_scid = None ;
837838 if let APIError :: ChannelUnavailable { .. } = e {
0 commit comments