@@ -434,23 +434,6 @@ where
434
434
. map_err ( |e| { self . payment_cache . lock ( ) . unwrap ( ) . remove ( & payment_hash) ; e } )
435
435
}
436
436
437
- /// Sends a probe payment along the given path. The resulting payment will not be cached and
438
- /// resulting failures will be handled differently from regular payments.
439
- pub fn send_probe_along_path (
440
- & self , pubkey : PublicKey , hops : & [ PublicKey ] , amount_msats : u64 , final_cltv_expiry_delta : u32
441
- ) -> Result < PaymentId , PaymentError > {
442
- let route_params = RouteParameters {
443
- payment_params : PaymentParameters :: for_keysend ( pubkey) ,
444
- final_value_msat : amount_msats,
445
- final_cltv_expiry_delta,
446
- } ;
447
- let payer = self . payer . node_id ( ) ;
448
- let route = self . router . build_route_from_hops ( & payer, hops, & route_params)
449
- . map_err ( |e| PaymentError :: Routing ( e) ) ?;
450
-
451
- self . payer . send_probe_payment ( & route) . map_err ( |e| PaymentError :: Sending ( e) )
452
- }
453
-
454
437
fn pay_internal < F : FnOnce ( & Route ) -> Result < PaymentId , PaymentSendFailure > + Copy > (
455
438
& self , params : & RouteParameters , payment_hash : PaymentHash , send_payment : F ,
456
439
) -> Result < PaymentId , PaymentError > {
@@ -565,6 +548,24 @@ where
565
548
pub fn remove_cached_payment ( & self , payment_hash : & PaymentHash ) {
566
549
self . payment_cache . lock ( ) . unwrap ( ) . remove ( payment_hash) ;
567
550
}
551
+
552
+ /// Sends a probe payment along the given path. The resulting payment will not be cached and
553
+ /// resulting failures will be handled differently from regular payments.
554
+ pub fn send_probe_along_path (
555
+ & self , pubkey : PublicKey , hops : & [ PublicKey ] , amount_msats : u64 , final_cltv_expiry_delta : u32
556
+ ) -> Result < PaymentId , PaymentError > {
557
+ let route_params = RouteParameters {
558
+ payment_params : PaymentParameters :: for_keysend ( pubkey) ,
559
+ final_value_msat : amount_msats,
560
+ final_cltv_expiry_delta,
561
+ } ;
562
+ let payer = self . payer . node_id ( ) ;
563
+ let route = self . router . build_route_from_hops ( & payer, hops, & route_params)
564
+ . map_err ( |e| PaymentError :: Routing ( e) ) ?;
565
+
566
+ self . payer . send_probe_payment ( & route) . map_err ( |e| PaymentError :: Sending ( e) )
567
+ }
568
+
568
569
}
569
570
570
571
fn expiry_time_from_unix_epoch ( invoice : & Invoice ) -> Duration {
0 commit comments