Skip to content

Payee abstraction for use in get_route and PaymentPathFailed #1134

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions fuzz/src/full_stack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ use lightning::ln::peer_handler::{MessageHandler,PeerManager,SocketDescriptor,Ig
use lightning::ln::msgs::DecodeError;
use lightning::ln::script::ShutdownScript;
use lightning::routing::network_graph::{NetGraphMsgHandler, NetworkGraph};
use lightning::routing::router::get_route;
use lightning::routing::router::{get_route, Payee};
use lightning::routing::scorer::Scorer;
use lightning::util::config::UserConfig;
use lightning::util::errors::APIError;
Expand Down Expand Up @@ -438,7 +438,8 @@ pub fn do_test(data: &[u8], logger: &Arc<dyn Logger>) {
},
4 => {
let value = slice_to_be24(get_slice!(3)) as u64;
let route = match get_route(&our_id, &net_graph_msg_handler.network_graph, &get_pubkey!(), None, None, &Vec::new(), value, 42, Arc::clone(&logger), &scorer) {
let payee = Payee::new(get_pubkey!());
let route = match get_route(&our_id, &payee, &net_graph_msg_handler.network_graph, None, value, 42, Arc::clone(&logger), &scorer) {
Ok(route) => route,
Err(_) => return,
};
Expand All @@ -455,7 +456,8 @@ pub fn do_test(data: &[u8], logger: &Arc<dyn Logger>) {
},
15 => {
let value = slice_to_be24(get_slice!(3)) as u64;
let mut route = match get_route(&our_id, &net_graph_msg_handler.network_graph, &get_pubkey!(), None, None, &Vec::new(), value, 42, Arc::clone(&logger), &scorer) {
let payee = Payee::new(get_pubkey!());
let mut route = match get_route(&our_id, &payee, &net_graph_msg_handler.network_graph, None, value, 42, Arc::clone(&logger), &scorer) {
Ok(route) => route,
Err(_) => return,
};
Expand Down
6 changes: 3 additions & 3 deletions fuzz/src/router.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use lightning::chain::transaction::OutPoint;
use lightning::ln::channelmanager::{ChannelDetails, ChannelCounterparty};
use lightning::ln::features::InitFeatures;
use lightning::ln::msgs;
use lightning::routing::router::{get_route, RouteHint, RouteHintHop};
use lightning::routing::router::{get_route, Payee, RouteHint, RouteHintHop};
use lightning::routing::scorer::Scorer;
use lightning::util::logger::Logger;
use lightning::util::ser::Readable;
Expand Down Expand Up @@ -250,9 +250,9 @@ pub fn do_test<Out: test_logger::Output>(data: &[u8], out: Out) {
}
let scorer = Scorer::new(0);
for target in node_pks.iter() {
let _ = get_route(&our_pubkey, &net_graph, target, None,
let payee = Payee::new(*target).with_route_hints(last_hops.clone());
let _ = get_route(&our_pubkey, &payee, &net_graph,
first_hops.map(|c| c.iter().collect::<Vec<_>>()).as_ref().map(|a| a.as_slice()),
&last_hops.iter().collect::<Vec<_>>(),
slice_to_be64(get_slice!(8)), slice_to_be32(get_slice!(4)), Arc::clone(&logger), &scorer);
}
},
Expand Down
4 changes: 2 additions & 2 deletions lightning-invoice/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1208,10 +1208,10 @@ impl Invoice {
}

/// Returns a list of all routes included in the invoice as the underlying hints
pub fn route_hints(&self) -> Vec<&RouteHint> {
pub fn route_hints(&self) -> Vec<RouteHint> {
find_all_extract!(
self.signed_invoice.known_tagged_fields(), TaggedField::PrivateRoute(ref x), x
).map(|route| &**route).collect()
).map(|route| (**route).clone()).collect()
}

/// Returns the currency for which the invoice was issued
Expand Down
8 changes: 4 additions & 4 deletions lightning-invoice/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,19 +113,19 @@ mod test {
assert_eq!(invoice.min_final_cltv_expiry(), MIN_FINAL_CLTV_EXPIRY as u64);
assert_eq!(invoice.description(), InvoiceDescription::Direct(&Description("test".to_string())));

let payee = router::Payee::new(invoice.recover_payee_pub_key())
.with_features(invoice.features().unwrap().clone())
.with_route_hints(invoice.route_hints());
let amt_msat = invoice.amount_pico_btc().unwrap() / 10;
let first_hops = nodes[0].node.list_usable_channels();
let last_hops = invoice.route_hints();
let network_graph = &nodes[0].net_graph_msg_handler.network_graph;
let logger = test_utils::TestLogger::new();
let scorer = Scorer::new(0);
let route = router::get_route(
&nodes[0].node.get_our_node_id(),
&payee,
network_graph,
&invoice.recover_payee_pub_key(),
Some(invoice.features().unwrap().clone()),
Some(&first_hops.iter().collect::<Vec<_>>()),
&last_hops,
amt_msat,
invoice.min_final_cltv_expiry() as u32,
&logger,
Expand Down
19 changes: 13 additions & 6 deletions lightning/src/ln/channelmanager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3036,6 +3036,7 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
all_paths_failed: payment.get().remaining_parts() == 0,
path: path.clone(),
short_channel_id: None,
retry: None,
#[cfg(test)]
error_code: None,
#[cfg(test)]
Expand Down Expand Up @@ -3103,6 +3104,7 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
all_paths_failed,
path: path.clone(),
short_channel_id,
retry: None,
#[cfg(test)]
error_code: onion_error_code,
#[cfg(test)]
Expand Down Expand Up @@ -3131,6 +3133,7 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
all_paths_failed,
path: path.clone(),
short_channel_id: Some(path.first().unwrap().short_channel_id),
retry: None,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, little confused why this isn't set anywhere atm -- maybe I should know this lol, but any TL;DR about how this PR fits into the largest retries picture?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TheBlueMatt is working on it. Getting this change in allows me to work on the InvoicePayer side independently.

#[cfg(test)]
error_code: Some(*failure_code),
#[cfg(test)]
Expand Down Expand Up @@ -5827,7 +5830,7 @@ mod tests {
use ln::functional_test_utils::*;
use ln::msgs;
use ln::msgs::ChannelMessageHandler;
use routing::router::{get_keysend_route, get_route};
use routing::router::{Payee, get_keysend_route, get_route};
use routing::scorer::Scorer;
use util::errors::APIError;
use util::events::{Event, MessageSendEvent, MessageSendEventsProvider};
Expand Down Expand Up @@ -6074,7 +6077,9 @@ mod tests {
let (payment_preimage, payment_hash, _) = route_payment(&nodes[0], &expected_route, 100_000);

// Next, attempt a keysend payment and make sure it fails.
let route = get_route(&nodes[0].node.get_our_node_id(), &nodes[0].net_graph_msg_handler.network_graph, &expected_route.last().unwrap().node.get_our_node_id(), Some(InvoiceFeatures::known()), None, &Vec::new(), 100_000, TEST_FINAL_CLTV, &logger, &scorer).unwrap();
let payee = Payee::new(expected_route.last().unwrap().node.get_our_node_id())
.with_features(InvoiceFeatures::known());
let route = get_route(&nodes[0].node.get_our_node_id(), &payee, &nodes[0].net_graph_msg_handler.network_graph, None, 100_000, TEST_FINAL_CLTV, &logger, &scorer).unwrap();
nodes[0].node.send_spontaneous_payment(&route, Some(payment_preimage)).unwrap();
check_added_monitors!(nodes[0], 1);
let mut events = nodes[0].node.get_and_clear_pending_msg_events();
Expand Down Expand Up @@ -6102,7 +6107,7 @@ mod tests {

// To start (2), send a keysend payment but don't claim it.
let payment_preimage = PaymentPreimage([42; 32]);
let route = get_route(&nodes[0].node.get_our_node_id(), &nodes[0].net_graph_msg_handler.network_graph, &expected_route.last().unwrap().node.get_our_node_id(), Some(InvoiceFeatures::known()), None, &Vec::new(), 100_000, TEST_FINAL_CLTV, &logger, &scorer).unwrap();
let route = get_route(&nodes[0].node.get_our_node_id(), &payee, &nodes[0].net_graph_msg_handler.network_graph, None, 100_000, TEST_FINAL_CLTV, &logger, &scorer).unwrap();
let (payment_hash, _) = nodes[0].node.send_spontaneous_payment(&route, Some(payment_preimage)).unwrap();
check_added_monitors!(nodes[0], 1);
let mut events = nodes[0].node.get_and_clear_pending_msg_events();
Expand Down Expand Up @@ -6256,7 +6261,7 @@ pub mod bench {
use ln::functional_test_utils::*;
use ln::msgs::{ChannelMessageHandler, Init};
use routing::network_graph::NetworkGraph;
use routing::router::get_route;
use routing::router::{Payee, get_route};
use routing::scorer::Scorer;
use util::test_utils;
use util::config::UserConfig;
Expand Down Expand Up @@ -6365,9 +6370,11 @@ pub mod bench {
macro_rules! send_payment {
($node_a: expr, $node_b: expr) => {
let usable_channels = $node_a.list_usable_channels();
let payee = Payee::new($node_b.get_our_node_id())
.with_features(InvoiceFeatures::known());
let scorer = Scorer::new(0);
let route = get_route(&$node_a.get_our_node_id(), &dummy_graph, &$node_b.get_our_node_id(), Some(InvoiceFeatures::known()),
Some(&usable_channels.iter().map(|r| r).collect::<Vec<_>>()), &[], 10_000, TEST_FINAL_CLTV, &logger_a, &scorer).unwrap();
let route = get_route(&$node_a.get_our_node_id(), &payee, &dummy_graph,
Some(&usable_channels.iter().map(|r| r).collect::<Vec<_>>()), 10_000, TEST_FINAL_CLTV, &logger_a, &scorer).unwrap();

let mut payment_preimage = PaymentPreimage([0; 32]);
payment_preimage.0[0..8].copy_from_slice(&payment_count.to_le_bytes());
Expand Down
22 changes: 14 additions & 8 deletions lightning/src/ln/functional_test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use chain::transaction::OutPoint;
use ln::{PaymentPreimage, PaymentHash, PaymentSecret};
use ln::channelmanager::{ChainParameters, ChannelManager, ChannelManagerReadArgs, RAACommitmentOrder, PaymentSendFailure};
use routing::network_graph::{NetGraphMsgHandler, NetworkGraph};
use routing::router::{Route, get_route};
use routing::router::{Payee, Route, get_route};
use routing::scorer::Scorer;
use ln::features::{InitFeatures, InvoiceFeatures};
use ln::msgs;
Expand Down Expand Up @@ -1011,13 +1011,15 @@ macro_rules! get_route_and_payment_hash {
}};
($send_node: expr, $recv_node: expr, $last_hops: expr, $recv_value: expr, $cltv: expr) => {{
let (payment_preimage, payment_hash, payment_secret) = get_payment_preimage_hash!($recv_node, Some($recv_value));
let payee = $crate::routing::router::Payee::new($recv_node.node.get_our_node_id())
.with_features($crate::ln::features::InvoiceFeatures::known())
.with_route_hints($last_hops);
let net_graph_msg_handler = &$send_node.net_graph_msg_handler;
let scorer = ::routing::scorer::Scorer::new(0);
let route = ::routing::router::get_route(
&$send_node.node.get_our_node_id(), &net_graph_msg_handler.network_graph,
&$recv_node.node.get_our_node_id(), Some(::ln::features::InvoiceFeatures::known()),
&$send_node.node.get_our_node_id(), &payee, &net_graph_msg_handler.network_graph,
Some(&$send_node.node.list_usable_channels().iter().collect::<Vec<_>>()),
&$last_hops, $recv_value, $cltv, $send_node.logger, &scorer
$recv_value, $cltv, $send_node.logger, &scorer
).unwrap();
(route, payment_hash, payment_preimage, payment_secret)
}}
Expand Down Expand Up @@ -1327,11 +1329,13 @@ pub fn claim_payment<'a, 'b, 'c>(origin_node: &Node<'a, 'b, 'c>, expected_route:
pub const TEST_FINAL_CLTV: u32 = 70;

pub fn route_payment<'a, 'b, 'c>(origin_node: &Node<'a, 'b, 'c>, expected_route: &[&Node<'a, 'b, 'c>], recv_value: u64) -> (PaymentPreimage, PaymentHash, PaymentSecret) {
let payee = Payee::new(expected_route.last().unwrap().node.get_our_node_id())
.with_features(InvoiceFeatures::known());
let net_graph_msg_handler = &origin_node.net_graph_msg_handler;
let scorer = Scorer::new(0);
let route = get_route(&origin_node.node.get_our_node_id(), &net_graph_msg_handler.network_graph,
&expected_route.last().unwrap().node.get_our_node_id(), Some(InvoiceFeatures::known()),
Some(&origin_node.node.list_usable_channels().iter().collect::<Vec<_>>()), &[],
let route = get_route(
&origin_node.node.get_our_node_id(), &payee, &net_graph_msg_handler.network_graph,
Some(&origin_node.node.list_usable_channels().iter().collect::<Vec<_>>()),
recv_value, TEST_FINAL_CLTV, origin_node.logger, &scorer).unwrap();
assert_eq!(route.paths.len(), 1);
assert_eq!(route.paths[0].len(), expected_route.len());
Expand All @@ -1343,9 +1347,11 @@ pub fn route_payment<'a, 'b, 'c>(origin_node: &Node<'a, 'b, 'c>, expected_route:
}

pub fn route_over_limit<'a, 'b, 'c>(origin_node: &Node<'a, 'b, 'c>, expected_route: &[&Node<'a, 'b, 'c>], recv_value: u64) {
let payee = Payee::new(expected_route.last().unwrap().node.get_our_node_id())
.with_features(InvoiceFeatures::known());
let net_graph_msg_handler = &origin_node.net_graph_msg_handler;
let scorer = Scorer::new(0);
let route = get_route(&origin_node.node.get_our_node_id(), &net_graph_msg_handler.network_graph, &expected_route.last().unwrap().node.get_our_node_id(), Some(InvoiceFeatures::known()), None, &Vec::new(), recv_value, TEST_FINAL_CLTV, origin_node.logger, &scorer).unwrap();
let route = get_route(&origin_node.node.get_our_node_id(), &payee, &net_graph_msg_handler.network_graph, None, recv_value, TEST_FINAL_CLTV, origin_node.logger, &scorer).unwrap();
assert_eq!(route.paths.len(), 1);
assert_eq!(route.paths[0].len(), expected_route.len());
for (node, hop) in expected_route.iter().zip(route.paths[0].iter()) {
Expand Down
21 changes: 12 additions & 9 deletions lightning/src/ln/functional_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use ln::channel::{Channel, ChannelError};
use ln::{chan_utils, onion_utils};
use ln::chan_utils::HTLC_SUCCESS_TX_WEIGHT;
use routing::network_graph::{NetworkUpdate, RoutingFees};
use routing::router::{Route, RouteHop, RouteHint, RouteHintHop, get_route, get_keysend_route};
use routing::router::{Payee, Route, RouteHop, RouteHint, RouteHintHop, get_route, get_keysend_route};
use routing::scorer::Scorer;
use ln::features::{ChannelFeatures, InitFeatures, InvoiceFeatures, NodeFeatures};
use ln::msgs;
Expand Down Expand Up @@ -6008,7 +6008,7 @@ fn test_fail_holding_cell_htlc_upon_free() {
let events = nodes[0].node.get_and_clear_pending_events();
assert_eq!(events.len(), 1);
match &events[0] {
&Event::PaymentPathFailed { ref payment_hash, ref rejected_by_dest, ref network_update, ref all_paths_failed, path: _, ref short_channel_id, ref error_code, ref error_data } => {
&Event::PaymentPathFailed { ref payment_hash, ref rejected_by_dest, ref network_update, ref all_paths_failed, path: _, ref short_channel_id, retry: _, ref error_code, ref error_data } => {
assert_eq!(our_payment_hash.clone(), *payment_hash);
assert_eq!(*rejected_by_dest, false);
assert_eq!(*all_paths_failed, true);
Expand Down Expand Up @@ -6092,7 +6092,7 @@ fn test_free_and_fail_holding_cell_htlcs() {
let events = nodes[0].node.get_and_clear_pending_events();
assert_eq!(events.len(), 1);
match &events[0] {
&Event::PaymentPathFailed { ref payment_hash, ref rejected_by_dest, ref network_update, ref all_paths_failed, path: _, ref short_channel_id, ref error_code, ref error_data } => {
&Event::PaymentPathFailed { ref payment_hash, ref rejected_by_dest, ref network_update, ref all_paths_failed, path: _, ref short_channel_id, retry: _, ref error_code, ref error_data } => {
assert_eq!(payment_hash_2.clone(), *payment_hash);
assert_eq!(*rejected_by_dest, false);
assert_eq!(*all_paths_failed, true);
Expand Down Expand Up @@ -7299,7 +7299,8 @@ fn test_check_htlc_underpaying() {
create_announced_chan_between_nodes(&nodes, 0, 1, InitFeatures::known(), InitFeatures::known());

let scorer = Scorer::new(0);
let route = get_route(&nodes[0].node.get_our_node_id(), &nodes[0].net_graph_msg_handler.network_graph, &nodes[1].node.get_our_node_id(), Some(InvoiceFeatures::known()), None, &Vec::new(), 10_000, TEST_FINAL_CLTV, nodes[0].logger, &scorer).unwrap();
let payee = Payee::new(nodes[1].node.get_our_node_id()).with_features(InvoiceFeatures::known());
let route = get_route(&nodes[0].node.get_our_node_id(), &payee, &nodes[0].net_graph_msg_handler.network_graph, None, 10_000, TEST_FINAL_CLTV, nodes[0].logger, &scorer).unwrap();
let (_, our_payment_hash, _) = get_payment_preimage_hash!(nodes[0]);
let our_payment_secret = nodes[1].node.create_inbound_payment_for_hash(our_payment_hash, Some(100_000), 7200, 0).unwrap();
nodes[0].node.send_payment(&route, our_payment_hash, &Some(our_payment_secret)).unwrap();
Expand Down Expand Up @@ -7487,7 +7488,7 @@ fn test_priv_forwarding_rejection() {
htlc_minimum_msat: None,
htlc_maximum_msat: None,
}]);
let last_hops = vec![&route_hint];
let last_hops = vec![route_hint];
let (route, our_payment_hash, our_payment_preimage, our_payment_secret) = get_route_and_payment_hash!(nodes[0], nodes[2], last_hops, 10_000, TEST_FINAL_CLTV);

nodes[0].node.send_payment(&route, our_payment_hash, &Some(our_payment_secret)).unwrap();
Expand Down Expand Up @@ -7696,12 +7697,14 @@ fn test_bump_penalty_txn_on_revoked_htlcs() {

let chan = create_announced_chan_between_nodes_with_value(&nodes, 0, 1, 1000000, 59000000, InitFeatures::known(), InitFeatures::known());
// Lock HTLC in both directions (using a slightly lower CLTV delay to provide timely RBF bumps)
let payee = Payee::new(nodes[1].node.get_our_node_id()).with_features(InvoiceFeatures::known());
let scorer = Scorer::new(0);
let route = get_route(&nodes[0].node.get_our_node_id(), &nodes[0].net_graph_msg_handler.network_graph,
&nodes[1].node.get_our_node_id(), Some(InvoiceFeatures::known()), None, &Vec::new(), 3_000_000, 50, nodes[0].logger, &scorer).unwrap();
let route = get_route(&nodes[0].node.get_our_node_id(), &payee, &nodes[0].net_graph_msg_handler.network_graph,
None, 3_000_000, 50, nodes[0].logger, &scorer).unwrap();
let payment_preimage = send_along_route(&nodes[0], route, &[&nodes[1]], 3_000_000).0;
let route = get_route(&nodes[1].node.get_our_node_id(), &nodes[1].net_graph_msg_handler.network_graph,
&nodes[0].node.get_our_node_id(), Some(InvoiceFeatures::known()), None, &Vec::new(), 3_000_000, 50, nodes[0].logger, &scorer).unwrap();
let payee = Payee::new(nodes[0].node.get_our_node_id()).with_features(InvoiceFeatures::known());
let route = get_route(&nodes[1].node.get_our_node_id(), &payee, &nodes[1].net_graph_msg_handler.network_graph,
None, 3_000_000, 50, nodes[0].logger, &scorer).unwrap();
send_along_route(&nodes[1], route, &[&nodes[0]], 3_000_000);

let revoked_local_txn = get_local_commitment_txn!(nodes[1], chan.2);
Expand Down
2 changes: 1 addition & 1 deletion lightning/src/ln/onion_route_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ fn run_onion_failure_test_with_fail_intercept<F1,F2,F3>(_name: &str, test_case:

let events = nodes[0].node.get_and_clear_pending_events();
assert_eq!(events.len(), 1);
if let &Event::PaymentPathFailed { payment_hash: _, ref rejected_by_dest, ref network_update, ref all_paths_failed, path: _, ref short_channel_id, ref error_code, error_data: _ } = &events[0] {
if let &Event::PaymentPathFailed { payment_hash: _, ref rejected_by_dest, ref network_update, ref all_paths_failed, path: _, ref short_channel_id, retry: _, ref error_code, error_data: _ } = &events[0] {
assert_eq!(*rejected_by_dest, !expected_retryable);
assert_eq!(*all_paths_failed, true);
assert_eq!(*error_code, expected_error_code);
Expand Down
8 changes: 5 additions & 3 deletions lightning/src/ln/shutdown_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use chain::keysinterface::KeysInterface;
use chain::transaction::OutPoint;
use ln::{PaymentPreimage, PaymentHash};
use ln::channelmanager::PaymentSendFailure;
use routing::router::get_route;
use routing::router::{Payee, get_route};
use routing::network_graph::NetworkUpdate;
use routing::scorer::Scorer;
use ln::features::{InitFeatures, InvoiceFeatures};
Expand Down Expand Up @@ -99,8 +99,10 @@ fn updates_shutdown_wait() {

let net_graph_msg_handler0 = &nodes[0].net_graph_msg_handler;
let net_graph_msg_handler1 = &nodes[1].net_graph_msg_handler;
let route_1 = get_route(&nodes[0].node.get_our_node_id(), &net_graph_msg_handler0.network_graph, &nodes[1].node.get_our_node_id(), Some(InvoiceFeatures::known()), None, &[], 100000, TEST_FINAL_CLTV, &logger, &scorer).unwrap();
let route_2 = get_route(&nodes[1].node.get_our_node_id(), &net_graph_msg_handler1.network_graph, &nodes[0].node.get_our_node_id(), Some(InvoiceFeatures::known()), None, &[], 100000, TEST_FINAL_CLTV, &logger, &scorer).unwrap();
let payee_1 = Payee::new(nodes[1].node.get_our_node_id()).with_features(InvoiceFeatures::known());
let route_1 = get_route(&nodes[0].node.get_our_node_id(), &payee_1, &net_graph_msg_handler0.network_graph, None, 100000, TEST_FINAL_CLTV, &logger, &scorer).unwrap();
let payee_2 = Payee::new(nodes[0].node.get_our_node_id()).with_features(InvoiceFeatures::known());
let route_2 = get_route(&nodes[1].node.get_our_node_id(), &payee_2, &net_graph_msg_handler1.network_graph, None, 100000, TEST_FINAL_CLTV, &logger, &scorer).unwrap();
unwrap_send_err!(nodes[0].node.send_payment(&route_1, payment_hash, &Some(payment_secret)), true, APIError::ChannelUnavailable {..}, {});
unwrap_send_err!(nodes[1].node.send_payment(&route_2, payment_hash, &Some(payment_secret)), true, APIError::ChannelUnavailable {..}, {});

Expand Down
3 changes: 3 additions & 0 deletions lightning/src/routing/network_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1814,6 +1814,7 @@ mod tests {
msg: valid_channel_update,
}),
short_channel_id: None,
retry: None,
error_code: None,
error_data: None,
});
Expand All @@ -1840,6 +1841,7 @@ mod tests {
is_permanent: false,
}),
short_channel_id: None,
retry: None,
error_code: None,
error_data: None,
});
Expand All @@ -1864,6 +1866,7 @@ mod tests {
is_permanent: true,
}),
short_channel_id: None,
retry: None,
error_code: None,
error_data: None,
});
Expand Down
Loading