impl<'a> CandidateRouteHop<'a> {
fn short_channel_id(&self) -> u64 {
match self {
- CandidateRouteHop::FirstHop { details } => details.short_channel_id.unwrap(),
+ CandidateRouteHop::FirstHop { details } => details.get_outbound_payment_scid().unwrap(),
CandidateRouteHop::PublicHop { short_channel_id, .. } => *short_channel_id,
CandidateRouteHop::PrivateHop { hint } => hint.short_channel_id,
}
HashMap::with_capacity(if first_hops.is_some() { first_hops.as_ref().unwrap().len() } else { 0 });
if let Some(hops) = first_hops {
for chan in hops {
- if chan.short_channel_id.is_none() {
+ if chan.get_outbound_payment_scid().is_none() {
panic!("first_hops should be filled in with usable channels, not pending ones");
}
if chan.counterparty.node_id == *our_node_pubkey {
let mut features_set = false;
if let Some(first_channels) = first_hop_targets.get(&ordered_hops.last().unwrap().0.node_id) {
for details in first_channels {
- if details.short_channel_id.unwrap() == ordered_hops.last().unwrap().0.candidate.short_channel_id() {
+ if details.get_outbound_payment_scid().unwrap() == ordered_hops.last().unwrap().0.candidate.short_channel_id() {
ordered_hops.last_mut().unwrap().1 = details.counterparty.features.to_context();
features_set = true;
break;
funding_txo: Some(OutPoint { txid: bitcoin::Txid::from_slice(&[0; 32]).unwrap(), index: 0 }),
channel_type: None,
short_channel_id,
+ outbound_scid_alias: None,
inbound_scid_alias: None,
channel_value_satoshis: 0,
user_channel_id: 0,
unspendable_punishment_reserve: None,
confirmations_required: None,
force_close_spend_delay: None,
- is_outbound: true, is_funding_locked: true,
+ is_outbound: true, is_channel_ready: true,
is_usable: true, is_public: true,
inbound_htlc_minimum_msat: None,
inbound_htlc_maximum_msat: None,
use chain::keysinterface::{KeysManager,KeysInterface};
use ln::channelmanager::{ChannelCounterparty, ChannelDetails};
use ln::features::{InitFeatures, InvoiceFeatures};
- use routing::scoring::{FixedPenaltyScorer, ProbabilisticScorer, ProbabilisticScoringParameters, Scorer};
+ use routing::scoring::{FixedPenaltyScorer, ProbabilisticScorer, ProbabilisticScoringParameters};
use util::logger::{Logger, Record};
use util::test_utils::TestLogger;
channel_type: None,
short_channel_id: Some(1),
inbound_scid_alias: None,
+ outbound_scid_alias: None,
channel_value_satoshis: 10_000_000,
user_channel_id: 0,
balance_msat: 10_000_000,
confirmations_required: None,
force_close_spend_delay: None,
is_outbound: true,
- is_funding_locked: true,
+ is_channel_ready: true,
is_usable: true,
is_public: true,
inbound_htlc_minimum_msat: None,
generate_routes(bench, &network_graph, scorer, InvoiceFeatures::known());
}
- #[bench]
- fn generate_routes_with_default_scorer(bench: &mut Bencher) {
- let network_graph = read_network_graph();
- let scorer = Scorer::default();
- generate_routes(bench, &network_graph, scorer, InvoiceFeatures::empty());
- }
-
- #[bench]
- fn generate_mpp_routes_with_default_scorer(bench: &mut Bencher) {
- let network_graph = read_network_graph();
- let scorer = Scorer::default();
- generate_routes(bench, &network_graph, scorer, InvoiceFeatures::known());
- }
-
#[bench]
fn generate_routes_with_probabilistic_scorer(bench: &mut Bencher) {
let logger = TestLogger::new();