@@ -271,10 +271,10 @@ 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 )
277
- -> Result < ( ) , PaymentSendFailure >
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
+ ) -> Result < ( ) , PaymentSendFailure >
278
278
where
279
279
K :: Target : KeysInterface ,
280
280
F : Fn ( & Vec < RouteHop > , & Option < PaymentParameters > , & PaymentHash , & Option < PaymentSecret > , u64 ,
@@ -284,10 +284,10 @@ 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 )
290
- -> Result < PaymentHash , PaymentSendFailure >
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
+ ) -> Result < PaymentHash , PaymentSendFailure >
291
291
where
292
292
K :: Target : KeysInterface ,
293
293
F : Fn ( & Vec < RouteHop > , & Option < PaymentParameters > , & PaymentHash , & Option < PaymentSecret > , u64 ,
@@ -306,9 +306,10 @@ 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 )
311
- -> Result < ( ) , PaymentSendFailure >
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
312
+ ) -> Result < ( ) , PaymentSendFailure >
312
313
where
313
314
K :: Target : KeysInterface ,
314
315
F : Fn ( & Vec < RouteHop > , & Option < PaymentParameters > , & PaymentHash , & Option < PaymentSecret > , u64 ,
@@ -374,9 +375,10 @@ 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 )
379
- -> Result < ( PaymentHash , PaymentId ) , PaymentSendFailure >
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
381
+ ) -> Result < ( PaymentHash , PaymentId ) , PaymentSendFailure >
380
382
where
381
383
K :: Target : KeysInterface ,
382
384
F : Fn ( & Vec < RouteHop > , & Option < PaymentParameters > , & PaymentHash , & Option < PaymentSecret > , u64 ,
@@ -401,10 +403,10 @@ 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 )
407
- -> Result < Vec < [ u8 ; 32 ] > , PaymentSendFailure > where K :: Target : KeysInterface {
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
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 ( ) {
410
412
onion_session_privs. push ( keys_manager. get_secure_random_bytes ( ) ) ;
@@ -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 , pending_events : & Mutex < Vec < events:: Event > > , 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 , pending_events : & Mutex < Vec < events:: Event > > , logger : & L )
563
565
where L :: Target : Logger {
564
566
let mut session_priv_bytes = [ 0 ; 32 ] ;
565
567
session_priv_bytes. copy_from_slice ( & session_priv[ ..] ) ;
@@ -665,11 +667,11 @@ impl OutboundPayments {
665
667
} ) ;
666
668
}
667
669
668
- pub ( super ) fn fail_htlc < L : Deref > ( & self , source : & HTLCSource , payment_hash : & PaymentHash ,
669
- onion_error : & HTLCFailReason , path : & Vec < RouteHop > , session_priv : & SecretKey ,
670
- payment_id : & PaymentId , payment_params : & Option < PaymentParameters > ,
671
- probing_cookie_secret : [ u8 ; 32 ] , secp_ctx : & Secp256k1 < secp256k1 :: All > ,
672
- pending_events : & Mutex < Vec < events:: Event > > , logger : & L )
670
+ pub ( super ) fn fail_htlc < L : Deref > (
671
+ & self , source : & HTLCSource , payment_hash : & PaymentHash , onion_error : & HTLCFailReason ,
672
+ path : & Vec < RouteHop > , session_priv : & SecretKey , payment_id : & PaymentId ,
673
+ payment_params : & Option < PaymentParameters > , probing_cookie_secret : [ u8 ; 32 ] ,
674
+ secp_ctx : & Secp256k1 < secp256k1 :: All > , pending_events : & Mutex < Vec < events:: Event > > , logger : & L )
673
675
where L :: Target : Logger {
674
676
let mut session_priv_bytes = [ 0 ; 32 ] ;
675
677
session_priv_bytes. copy_from_slice ( & session_priv[ ..] ) ;
0 commit comments