@@ -796,11 +796,11 @@ impl OutboundPayments {
796
796
{
797
797
match err {
798
798
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) ;
800
800
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) ;
801
801
} ,
802
802
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) ;
804
804
// Some paths were sent, even if we failed to send the full MPP value our recipient may
805
805
// misbehave and claim the funds, at which point we have to consider the payment sent, so
806
806
// return `Ok()` here, ignoring any retry errors.
@@ -813,7 +813,7 @@ impl OutboundPayments {
813
813
} ,
814
814
PaymentSendFailure :: PathParameterError ( results) => {
815
815
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) ;
817
817
self . abandon_payment ( payment_id, PaymentFailureReason :: UnexpectedError , pending_events) ;
818
818
} ,
819
819
PaymentSendFailure :: ParameterError ( e) => {
@@ -824,15 +824,16 @@ impl OutboundPayments {
824
824
}
825
825
}
826
826
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 > (
828
828
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 {
831
831
let mut events = pending_events. lock ( ) . unwrap ( ) ;
832
832
debug_assert_eq ! ( paths. len( ) , path_results. len( ) ) ;
833
833
for ( path, path_res) in paths. into_iter ( ) . zip ( path_results) {
834
834
if let Err ( e) = path_res {
835
835
if let APIError :: MonitorUpdateInProgress = e { continue }
836
+ log_error ! ( logger, "Failed to send along path due to error: {:?}" , e) ;
836
837
let mut failed_scid = None ;
837
838
if let APIError :: ChannelUnavailable { .. } = e {
838
839
let scid = path[ 0 ] . short_channel_id ;
0 commit comments