14
14
15
15
use bitcoin:: secp256k1:: PublicKey ;
16
16
17
- use crate :: ln:: channelmanager:: ChannelDetails ;
17
+ use crate :: ln:: PaymentHash ;
18
+ use crate :: ln:: channelmanager:: { ChannelDetails , PaymentId } ;
18
19
use crate :: ln:: features:: { ChannelFeatures , InvoiceFeatures , NodeFeatures } ;
19
20
use crate :: ln:: msgs:: { DecodeError , ErrorAction , LightningError , MAX_VALUE_MSAT } ;
20
21
use crate :: routing:: gossip:: { DirectedChannelInfo , EffectiveCapacity , ReadOnlyNetworkGraph , NetworkGraph , NodeId , RoutingFees } ;
@@ -36,6 +37,15 @@ pub trait Router {
36
37
& self , payer : & PublicKey , route_params : & RouteParameters ,
37
38
first_hops : Option < & [ & ChannelDetails ] > , inflight_htlcs : InFlightHtlcs
38
39
) -> Result < Route , LightningError > ;
40
+ /// Finds a [`Route`] between `payer` and `payee` for a payment with the given values. Includes
41
+ /// `PaymentHash` and `PaymentId` to be able to correlate the request with a specific payment.
42
+ fn find_route_with_id (
43
+ & self , payer : & PublicKey , route_params : & RouteParameters ,
44
+ first_hops : Option < & [ & ChannelDetails ] > , inflight_htlcs : InFlightHtlcs ,
45
+ _payment_hash : PaymentHash , _payment_id : PaymentId
46
+ ) -> Result < Route , LightningError > {
47
+ self . find_route ( payer, route_params, first_hops, inflight_htlcs)
48
+ }
39
49
/// Lets the router know that payment through a specific path has failed.
40
50
fn notify_payment_path_failed ( & self , path : & [ & RouteHop ] , short_channel_id : u64 ) ;
41
51
/// Lets the router know that payment through a specific path was successful.
0 commit comments