Skip to content

Commit 085d51b

Browse files
committed
Restore ChannelManager::send_payment_with_route
e41e756 removed `ChannelManager::send_payment_with_route` due to a rebase error as it was originally written when `send_payment_with_route` had been made test-only. Here we restore it to be public.
1 parent df68774 commit 085d51b

File tree

2 files changed

+1
-8
lines changed

2 files changed

+1
-8
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,7 @@ use crate::types::features::{Bolt12InvoiceFeatures, ChannelFeatures, ChannelType
5656
use crate::types::features::Bolt11InvoiceFeatures;
5757
#[cfg(trampoline)]
5858
use crate::routing::gossip::NodeId;
59-
use crate::routing::router::{BlindedTail, InFlightHtlcs, Path, Payee, PaymentParameters, RouteParameters, RouteParametersConfig, Router};
60-
#[cfg(any(feature = "_test_utils", test))]
61-
use crate::routing::router::{FixedRouter, Route};
59+
use crate::routing::router::{BlindedTail, InFlightHtlcs, Path, Payee, PaymentParameters, RouteParameters, RouteParametersConfig, Router, FixedRouter, Route};
6260
use crate::ln::onion_payment::{check_incoming_htlc_cltv, create_recv_pending_htlc_info, create_fwd_pending_htlc_info, decode_incoming_update_add_htlc_onion, InboundHTLCErr, NextPacketDetails};
6361
use crate::ln::msgs;
6462
use crate::ln::onion_utils;
@@ -4670,7 +4668,6 @@ where
46704668
///
46714669
/// LDK will not automatically retry this payment, though it may be manually re-sent after an
46724670
/// [`Event::PaymentFailed`] is generated.
4673-
#[cfg(any(test, feature = "_test_utils"))]
46744671
pub fn send_payment_with_route(
46754672
&self, mut route: Route, payment_hash: PaymentHash, recipient_onion: RecipientOnionFields,
46764673
payment_id: PaymentId

lightning/src/routing/router.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ use crate::offers::invoice::Bolt12Invoice;
2525
use crate::routing::gossip::{DirectedChannelInfo, EffectiveCapacity, ReadOnlyNetworkGraph, NetworkGraph, NodeId};
2626
use crate::routing::scoring::{ChannelUsage, LockableScore, ScoreLookUp};
2727
use crate::sign::EntropySource;
28-
#[cfg(any(test, feature = "_test_utils"))]
2928
use crate::sync::Mutex;
3029
use crate::util::ser::{Writeable, Readable, ReadableArgs, Writer};
3130
use crate::util::logger::Logger;
@@ -190,20 +189,17 @@ impl<G: Deref<Target = NetworkGraph<L>>, L: Deref, ES: Deref, S: Deref, SP: Size
190189
/// A `Router` that returns a fixed route one time, erroring otherwise. Useful for
191190
/// `ChannelManager::send_payment_with_route` to support sending to specific routes without
192191
/// requiring a custom `Router` implementation.
193-
#[cfg(any(test, feature = "_test_utils"))]
194192
pub(crate) struct FixedRouter {
195193
// Use an `Option` to avoid needing to clone the route when `find_route` is called.
196194
route: Mutex<Option<Route>>,
197195
}
198196

199-
#[cfg(any(test, feature = "_test_utils"))]
200197
impl FixedRouter {
201198
pub(crate) fn new(route: Route) -> Self {
202199
Self { route: Mutex::new(Some(route)) }
203200
}
204201
}
205202

206-
#[cfg(any(test, feature = "_test_utils"))]
207203
impl Router for FixedRouter {
208204
fn find_route(
209205
&self, _payer: &PublicKey, _route_params: &RouteParameters,

0 commit comments

Comments
 (0)