@@ -339,10 +339,11 @@ where
339339 fn pay_internal < F : FnOnce ( & Route ) -> Result < PaymentId , PaymentSendFailure > + Copy > (
340340 & self , params : & RouteParameters , payment_hash : PaymentHash , send_payment : F ,
341341 ) -> Result < PaymentId , PaymentError > {
342- #[ cfg( feature = "std" ) ]
343- if has_expired ( params) {
344- log_trace ! ( self . logger, "Invoice expired prior to send for payment {}" , log_bytes!( payment_hash. 0 ) ) ;
345- return Err ( PaymentError :: Invoice ( "Invoice expired prior to send" ) ) ;
342+ #[ cfg( feature = "std" ) ] {
343+ if has_expired ( params) {
344+ log_trace ! ( self . logger, "Invoice expired prior to send for payment {}" , log_bytes!( payment_hash. 0 ) ) ;
345+ return Err ( PaymentError :: Invoice ( "Invoice expired prior to send" ) ) ;
346+ }
346347 }
347348
348349 let payer = self . payer . node_id ( ) ;
@@ -402,10 +403,11 @@ where
402403 return Err ( ( ) ) ;
403404 }
404405
405- #[ cfg( feature = "std" ) ]
406- if has_expired ( params) {
407- log_trace ! ( self . logger, "Invoice expired for payment {}; not retrying (attempts: {})" , log_bytes!( payment_hash. 0 ) , attempts) ;
408- return Err ( ( ) ) ;
406+ #[ cfg( feature = "std" ) ] {
407+ if has_expired ( params) {
408+ log_trace ! ( self . logger, "Invoice expired for payment {}; not retrying (attempts: {})" , log_bytes!( payment_hash. 0 ) , attempts) ;
409+ return Err ( ( ) ) ;
410+ }
409411 }
410412
411413 let payer = self . payer . node_id ( ) ;
0 commit comments