@@ -271,9 +271,9 @@ impl OutboundPayments {
271
271
}
272
272
}
273
273
274
- pub ( super ) fn send_payment < K : Deref , F > ( & self , route : & Route , payment_hash : PaymentHash ,
275
- payment_secret : & Option < PaymentSecret > , payment_id : PaymentId , keys_manager : & K ,
276
- best_block_height : u32 , send_payment_along_path : F )
274
+ pub ( super ) fn send_payment < K : Deref , F > (
275
+ & self , route : & Route , payment_hash : PaymentHash , payment_secret : & Option < PaymentSecret > ,
276
+ payment_id : PaymentId , keys_manager : & K , best_block_height : u32 , send_payment_along_path : F )
277
277
-> Result < ( ) , PaymentSendFailure >
278
278
where
279
279
K :: Target : KeysInterface ,
@@ -284,9 +284,9 @@ impl OutboundPayments {
284
284
self . send_payment_internal ( route, payment_hash, payment_secret, None , payment_id, None , onion_session_privs, keys_manager, best_block_height, send_payment_along_path)
285
285
}
286
286
287
- pub ( super ) fn send_spontaneous_payment < K : Deref , F > ( & self , route : & Route ,
288
- payment_preimage : Option < PaymentPreimage > , payment_id : PaymentId , keys_manager : & K ,
289
- best_block_height : u32 , send_payment_along_path : F )
287
+ pub ( super ) fn send_spontaneous_payment < K : Deref , F > (
288
+ & self , route : & Route , payment_preimage : Option < PaymentPreimage > , payment_id : PaymentId ,
289
+ keys_manager : & K , best_block_height : u32 , send_payment_along_path : F )
290
290
-> Result < PaymentHash , PaymentSendFailure >
291
291
where
292
292
K :: Target : KeysInterface ,
@@ -306,8 +306,9 @@ impl OutboundPayments {
306
306
}
307
307
}
308
308
309
- pub ( super ) fn retry_payment < K : Deref , F > ( & self , route : & Route , payment_id : PaymentId ,
310
- keys_manager : & K , best_block_height : u32 , send_payment_along_path : F )
309
+ pub ( super ) fn retry_payment < K : Deref , F > (
310
+ & self , route : & Route , payment_id : PaymentId , keys_manager : & K , best_block_height : u32 ,
311
+ send_payment_along_path : F )
311
312
-> Result < ( ) , PaymentSendFailure >
312
313
where
313
314
K :: Target : KeysInterface ,
@@ -374,8 +375,9 @@ impl OutboundPayments {
374
375
self . send_payment_internal ( route, payment_hash, & payment_secret, None , payment_id, Some ( total_msat) , onion_session_privs, keys_manager, best_block_height, send_payment_along_path)
375
376
}
376
377
377
- pub ( super ) fn send_probe < K : Deref , F > ( & self , hops : Vec < RouteHop > , probing_cookie_secret : [ u8 ; 32 ] ,
378
- keys_manager : & K , best_block_height : u32 , send_payment_along_path : F )
378
+ pub ( super ) fn send_probe < K : Deref , F > (
379
+ & self , hops : Vec < RouteHop > , probing_cookie_secret : [ u8 ; 32 ] , keys_manager : & K ,
380
+ best_block_height : u32 , send_payment_along_path : F )
379
381
-> Result < ( PaymentHash , PaymentId ) , PaymentSendFailure >
380
382
where
381
383
K :: Target : KeysInterface ,
@@ -401,9 +403,9 @@ impl OutboundPayments {
401
403
}
402
404
}
403
405
404
- pub ( super ) fn add_new_pending_payment < K : Deref > ( & self , payment_hash : PaymentHash ,
405
- payment_secret : Option < PaymentSecret > , payment_id : PaymentId , route : & Route , keys_manager : & K ,
406
- best_block_height : u32 )
406
+ pub ( super ) fn add_new_pending_payment < K : Deref > (
407
+ & self , payment_hash : PaymentHash , payment_secret : Option < PaymentSecret > , payment_id : PaymentId ,
408
+ route : & Route , keys_manager : & K , best_block_height : u32 )
407
409
-> Result < Vec < [ u8 ; 32 ] > , PaymentSendFailure > where K :: Target : KeysInterface {
408
410
let mut onion_session_privs = Vec :: with_capacity ( route. paths . len ( ) ) ;
409
411
for _ in 0 ..route. paths . len ( ) {
@@ -433,8 +435,8 @@ impl OutboundPayments {
433
435
}
434
436
}
435
437
436
- fn send_payment_internal < K : Deref , F >
437
- ( & self , route : & Route , payment_hash : PaymentHash , payment_secret : & Option < PaymentSecret > ,
438
+ fn send_payment_internal < K : Deref , F > (
439
+ & self , route : & Route , payment_hash : PaymentHash , payment_secret : & Option < PaymentSecret > ,
438
440
keysend_preimage : Option < PaymentPreimage > , payment_id : PaymentId , recv_value_msat : Option < u64 > ,
439
441
onion_session_privs : Vec < [ u8 ; 32 ] > , keys_manager : & K , best_block_height : u32 ,
440
442
send_payment_along_path : F ) -> Result < ( ) , PaymentSendFailure >
@@ -542,11 +544,11 @@ impl OutboundPayments {
542
544
}
543
545
544
546
#[ cfg( test) ]
545
- pub ( super ) fn test_send_payment_internal < K : Deref , F >
546
- ( & self , route : & Route , payment_hash : PaymentHash , payment_secret : & Option < PaymentSecret > ,
547
- keysend_preimage : Option < PaymentPreimage > , payment_id : PaymentId , recv_value_msat : Option < u64 > ,
548
- onion_session_privs : Vec < [ u8 ; 32 ] > , keys_manager : & K , best_block_height : u32 ,
549
- send_payment_along_path : F ) -> Result < ( ) , PaymentSendFailure >
547
+ pub ( super ) fn test_send_payment_internal < K : Deref , F > (
548
+ & self , route : & Route , payment_hash : PaymentHash , payment_secret : & Option < PaymentSecret > ,
549
+ keysend_preimage : Option < PaymentPreimage > , payment_id : PaymentId , recv_value_msat : Option < u64 > ,
550
+ onion_session_privs : Vec < [ u8 ; 32 ] > , keys_manager : & K , best_block_height : u32 ,
551
+ send_payment_along_path : F ) -> Result < ( ) , PaymentSendFailure >
550
552
where
551
553
K :: Target : KeysInterface ,
552
554
F : Fn ( & Vec < RouteHop > , & Option < PaymentParameters > , & PaymentHash , & Option < PaymentSecret > , u64 ,
@@ -557,9 +559,9 @@ impl OutboundPayments {
557
559
send_payment_along_path)
558
560
}
559
561
560
- pub ( super ) fn claim_htlc < L : Deref > ( & self , payment_id : PaymentId ,
561
- payment_preimage : PaymentPreimage , session_priv : SecretKey , path : Vec < RouteHop > ,
562
- from_onchain : bool , logger : & L )
562
+ pub ( super ) fn claim_htlc < L : Deref > (
563
+ & self , payment_id : PaymentId , payment_preimage : PaymentPreimage , session_priv : SecretKey ,
564
+ path : Vec < RouteHop > , from_onchain : bool , logger : & L )
563
565
-> ( Option < events:: Event > , Option < events:: Event > ) where L :: Target : Logger {
564
566
let mut payment_sent_ev = None ;
565
567
let mut path_success_ev = None ;
@@ -666,10 +668,11 @@ impl OutboundPayments {
666
668
} ) ;
667
669
}
668
670
669
- pub ( super ) fn fail_htlc < L : Deref > ( & self , source : & HTLCSource , payment_hash : & PaymentHash ,
670
- onion_error : & HTLCFailReason , path : & Vec < RouteHop > , session_priv : & SecretKey ,
671
- payment_id : & PaymentId , payment_params : & Option < PaymentParameters > ,
672
- probing_cookie_secret : [ u8 ; 32 ] , secp_ctx : & Secp256k1 < secp256k1:: All > , logger : & L )
671
+ pub ( super ) fn fail_htlc < L : Deref > (
672
+ & self , source : & HTLCSource , payment_hash : & PaymentHash , onion_error : & HTLCFailReason ,
673
+ path : & Vec < RouteHop > , session_priv : & SecretKey , payment_id : & PaymentId ,
674
+ payment_params : & Option < PaymentParameters > , probing_cookie_secret : [ u8 ; 32 ] ,
675
+ secp_ctx : & Secp256k1 < secp256k1:: All > , logger : & L )
673
676
-> ( Option < events:: Event > , Option < events:: Event > ) where L :: Target : Logger {
674
677
let mut session_priv_bytes = [ 0 ; 32 ] ;
675
678
session_priv_bytes. copy_from_slice ( & session_priv[ ..] ) ;
0 commit comments