Skip to content

Commit 3d954ee

Browse files
f re-add find_route_with_id
1 parent b45381b commit 3d954ee

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

lightning/src/routing/router.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
1515
use bitcoin::secp256k1::PublicKey;
1616

17-
use crate::ln::channelmanager::ChannelDetails;
17+
use crate::ln::PaymentHash;
18+
use crate::ln::channelmanager::{ChannelDetails, PaymentId};
1819
use crate::ln::features::{ChannelFeatures, InvoiceFeatures, NodeFeatures};
1920
use crate::ln::msgs::{DecodeError, ErrorAction, LightningError, MAX_VALUE_MSAT};
2021
use crate::routing::gossip::{DirectedChannelInfo, EffectiveCapacity, ReadOnlyNetworkGraph, NetworkGraph, NodeId, RoutingFees};
@@ -36,6 +37,15 @@ pub trait Router {
3637
&self, payer: &PublicKey, route_params: &RouteParameters,
3738
first_hops: Option<&[&ChannelDetails]>, inflight_htlcs: InFlightHtlcs
3839
) -> 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+
}
3949
/// Lets the router know that payment through a specific path has failed.
4050
fn notify_payment_path_failed(&self, path: &[&RouteHop], short_channel_id: u64);
4151
/// Lets the router know that payment through a specific path was successful.

0 commit comments

Comments
 (0)