You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Filter the route hints in `create_invoice_from_channelmanager` based on
the following criteria:
* Only one channel per counterparty node
* Always select the channel with the highest inbound capacity
* Filter out channels with a lower inbound capacity than the invoice amt
* If any private channel exists, the invoice rout_hints should be empty
Copy file name to clipboardExpand all lines: lightning-invoice/src/utils.rs
+84-25Lines changed: 84 additions & 25 deletions
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ use lightning::chain;
10
10
use lightning::chain::chaininterface::{BroadcasterInterface,FeeEstimator};
11
11
use lightning::chain::keysinterface::{Recipient,KeysInterface,Sign};
12
12
use lightning::ln::{PaymentHash,PaymentPreimage,PaymentSecret};
13
-
use lightning::ln::channelmanager::{ChannelDetails,ChannelManager,PaymentId,PaymentSendFailure,PhantomRouteHints,MIN_FINAL_CLTV_EXPIRY,MIN_CLTV_EXPIRY_DELTA};
13
+
use lightning::ln::channelmanager::{ChannelDetails,ChannelManager,PaymentId,PaymentSendFailure,PhantomRouteHints,CounterpartyForwardingInfo,MIN_FINAL_CLTV_EXPIRY,MIN_CLTV_EXPIRY_DELTA};
14
14
use lightning::ln::msgs::LightningError;
15
15
use lightning::routing::scoring::Score;
16
16
use lightning::routing::network_graph::{NetworkGraph,RoutingFees};
@@ -158,30 +158,10 @@ where
158
158
F::Target:FeeEstimator,
159
159
L::Target:Logger,
160
160
{
161
-
// Marshall route hints.
162
-
let our_channels = channelmanager.list_usable_channels();
163
-
letmut route_hints = vec![];
164
-
for channel in our_channels {
165
-
let short_channel_id = match channel.short_channel_id{
166
-
Some(id) => id,
167
-
None => continue,
168
-
};
169
-
let forwarding_info = match channel.counterparty.forwarding_info{
0 commit comments