Skip to content

Commit 85fe2cb

Browse files
Add Path struct and have Route contain a vec of Paths
1 parent 7df670d commit 85fe2cb

14 files changed

+641
-606
lines changed

fuzz/src/chanmon_consistency.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ use lightning::util::logger::Logger;
5050
use lightning::util::config::UserConfig;
5151
use lightning::util::events::MessageSendEventsProvider;
5252
use lightning::util::ser::{Readable, ReadableArgs, Writeable, Writer};
53-
use lightning::routing::router::{InFlightHtlcs, Route, RouteHop, RouteParameters, Router};
53+
use lightning::routing::router::{InFlightHtlcs, Path, Route, RouteHop, RouteParameters, Router};
5454

5555
use crate::utils::test_logger::{self, Output};
5656
use crate::utils::test_persister::TestPersister;
@@ -352,14 +352,14 @@ fn send_payment(source: &ChanMan, dest: &ChanMan, dest_chan_id: u64, amt: u64, p
352352
payment_id[0..8].copy_from_slice(&payment_idx.to_ne_bytes());
353353
*payment_idx += 1;
354354
if let Err(err) = source.send_payment(&Route {
355-
paths: vec![vec![RouteHop {
355+
paths: vec![Path { hops: vec![RouteHop {
356356
pubkey: dest.get_our_node_id(),
357357
node_features: dest.node_features(),
358358
short_channel_id: dest_chan_id,
359359
channel_features: dest.channel_features(),
360360
fee_msat: amt,
361361
cltv_expiry_delta: 200,
362-
}]],
362+
}], blinded_tail: None }],
363363
payment_params: None,
364364
}, payment_hash, &Some(payment_secret), PaymentId(payment_id)) {
365365
check_payment_err(err);
@@ -374,7 +374,7 @@ fn send_hop_payment(source: &ChanMan, middle: &ChanMan, middle_chan_id: u64, des
374374
payment_id[0..8].copy_from_slice(&payment_idx.to_ne_bytes());
375375
*payment_idx += 1;
376376
if let Err(err) = source.send_payment(&Route {
377-
paths: vec![vec![RouteHop {
377+
paths: vec![Path { hops: vec![RouteHop {
378378
pubkey: middle.get_our_node_id(),
379379
node_features: middle.node_features(),
380380
short_channel_id: middle_chan_id,
@@ -388,7 +388,7 @@ fn send_hop_payment(source: &ChanMan, middle: &ChanMan, middle_chan_id: u64, des
388388
channel_features: dest.channel_features(),
389389
fee_msat: amt,
390390
cltv_expiry_delta: 200,
391-
}]],
391+
}], blinded_tail: None }],
392392
payment_params: None,
393393
}, payment_hash, &Some(payment_secret), PaymentId(payment_id)) {
394394
check_payment_err(err);

lightning-invoice/src/utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1173,7 +1173,7 @@ mod test {
11731173
nodes[fwd_idx].node.process_pending_htlc_forwards();
11741174

11751175
let payment_preimage_opt = if user_generated_pmt_hash { None } else { Some(payment_preimage) };
1176-
expect_payment_claimable!(&nodes[fwd_idx], payment_hash, payment_secret, payment_amt, payment_preimage_opt, route.paths[0].last().unwrap().pubkey);
1176+
expect_payment_claimable!(&nodes[fwd_idx], payment_hash, payment_secret, payment_amt, payment_preimage_opt, route.paths[0].hops.last().unwrap().pubkey);
11771177
do_claim_payment_along_route(&nodes[0], &[&vec!(&nodes[fwd_idx])[..]], false, payment_preimage);
11781178
let events = nodes[0].node.get_and_clear_pending_events();
11791179
assert_eq!(events.len(), 2);

lightning/src/ln/chanmon_update_fail_tests.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1970,12 +1970,12 @@ fn test_path_paused_mpp() {
19701970
// Set us up to take multiple routes, one 0 -> 1 -> 3 and one 0 -> 2 -> 3:
19711971
let path = route.paths[0].clone();
19721972
route.paths.push(path);
1973-
route.paths[0][0].pubkey = nodes[1].node.get_our_node_id();
1974-
route.paths[0][0].short_channel_id = chan_1_id;
1975-
route.paths[0][1].short_channel_id = chan_3_id;
1976-
route.paths[1][0].pubkey = nodes[2].node.get_our_node_id();
1977-
route.paths[1][0].short_channel_id = chan_2_ann.contents.short_channel_id;
1978-
route.paths[1][1].short_channel_id = chan_4_id;
1973+
route.paths[0].hops[0].pubkey = nodes[1].node.get_our_node_id();
1974+
route.paths[0].hops[0].short_channel_id = chan_1_id;
1975+
route.paths[0].hops[1].short_channel_id = chan_3_id;
1976+
route.paths[1].hops[0].pubkey = nodes[2].node.get_our_node_id();
1977+
route.paths[1].hops[0].short_channel_id = chan_2_ann.contents.short_channel_id;
1978+
route.paths[1].hops[1].short_channel_id = chan_4_id;
19791979

19801980
// Set it so that the first monitor update (for the path 0 -> 1 -> 3) succeeds, but the second
19811981
// (for the path 0 -> 2 -> 3) fails.

lightning/src/ln/channelmanager.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ use crate::ln::features::{ChannelFeatures, ChannelTypeFeatures, InitFeatures, No
4343
#[cfg(any(feature = "_test_utils", test))]
4444
use crate::ln::features::InvoiceFeatures;
4545
use crate::routing::gossip::NetworkGraph;
46-
use crate::routing::router::{DefaultRouter, InFlightHtlcs, PaymentParameters, Route, RouteHop, RouteParameters, RoutePath, Router};
46+
use crate::routing::router::{DefaultRouter, InFlightHtlcs, Path, PaymentParameters, Route, RouteHop, RouteParameters, RoutePath, Router};
4747
use crate::routing::scoring::ProbabilisticScorer;
4848
use crate::ln::msgs;
4949
use crate::ln::onion_utils;
@@ -2488,16 +2488,16 @@ where
24882488
}
24892489

24902490
#[cfg(test)]
2491-
pub(crate) fn test_send_payment_along_path(&self, path: &Vec<RouteHop>, payment_hash: &PaymentHash, payment_secret: &Option<PaymentSecret>, total_value: u64, cur_height: u32, payment_id: PaymentId, keysend_preimage: &Option<PaymentPreimage>, session_priv_bytes: [u8; 32]) -> Result<(), APIError> {
2491+
pub(crate) fn test_send_payment_along_path(&self, path: &Path, payment_hash: &PaymentHash, payment_secret: &Option<PaymentSecret>, total_value: u64, cur_height: u32, payment_id: PaymentId, keysend_preimage: &Option<PaymentPreimage>, session_priv_bytes: [u8; 32]) -> Result<(), APIError> {
24922492
let _lck = self.total_consistency_lock.read().unwrap();
24932493
self.send_payment_along_path(path, payment_hash, payment_secret, total_value, cur_height, payment_id, keysend_preimage, session_priv_bytes)
24942494
}
24952495

2496-
fn send_payment_along_path(&self, path: &Vec<RouteHop>, payment_hash: &PaymentHash, payment_secret: &Option<PaymentSecret>, total_value: u64, cur_height: u32, payment_id: PaymentId, keysend_preimage: &Option<PaymentPreimage>, session_priv_bytes: [u8; 32]) -> Result<(), APIError> {
2496+
fn send_payment_along_path(&self, path: &Path, payment_hash: &PaymentHash, payment_secret: &Option<PaymentSecret>, total_value: u64, cur_height: u32, payment_id: PaymentId, keysend_preimage: &Option<PaymentPreimage>, session_priv_bytes: [u8; 32]) -> Result<(), APIError> {
24972497
// The top-level caller should hold the total_consistency_lock read lock.
24982498
debug_assert!(self.total_consistency_lock.try_write().is_err());
24992499

2500-
log_trace!(self.logger, "Attempting to send payment for path with next hop {}", path.first().unwrap().short_channel_id);
2500+
log_trace!(self.logger, "Attempting to send payment for path with next hop {}", path.hops.first().unwrap().short_channel_id);
25012501
let prng_seed = self.entropy_source.get_secure_random_bytes();
25022502
let session_priv = SecretKey::from_slice(&session_priv_bytes[..]).expect("RNG is busted");
25032503

@@ -2510,7 +2510,7 @@ where
25102510
let onion_packet = onion_utils::construct_onion_packet(onion_payloads, onion_keys, prng_seed, payment_hash);
25112511

25122512
let err: Result<(), _> = loop {
2513-
let (counterparty_node_id, id) = match self.short_to_chan_info.read().unwrap().get(&path.first().unwrap().short_channel_id) {
2513+
let (counterparty_node_id, id) = match self.short_to_chan_info.read().unwrap().get(&path.hops.first().unwrap().short_channel_id) {
25142514
None => return Err(APIError::ChannelUnavailable{err: "No channel available with first hop!".to_owned()}),
25152515
Some((cp_id, chan_id)) => (cp_id.clone(), chan_id.clone()),
25162516
};
@@ -2527,7 +2527,7 @@ where
25272527
let funding_txo = chan.get().get_funding_txo().unwrap();
25282528
let send_res = chan.get_mut().send_htlc_and_commit(htlc_msat, payment_hash.clone(),
25292529
htlc_cltv, HTLCSource::OutboundRoute {
2530-
path: path.clone(),
2530+
path: path.hops.clone(),
25312531
session_priv: session_priv.clone(),
25322532
first_hop_htlc_msat: htlc_msat,
25332533
payment_id,
@@ -2562,7 +2562,7 @@ where
25622562
return Ok(());
25632563
};
25642564

2565-
match handle_error!(self, err, path.first().unwrap().pubkey) {
2565+
match handle_error!(self, err, path.hops.first().unwrap().pubkey) {
25662566
Ok(_) => unreachable!(),
25672567
Err(e) => {
25682568
Err(APIError::ChannelUnavailable { err: e.err })
@@ -8071,15 +8071,15 @@ mod tests {
80718071
Event::PaymentPathSuccessful { payment_id: ref actual_payment_id, ref payment_hash, ref path } => {
80728072
assert_eq!(payment_id, *actual_payment_id);
80738073
assert_eq!(our_payment_hash, *payment_hash.as_ref().unwrap());
8074-
assert_eq!(route.paths[0], *path);
8074+
assert_eq!(route.paths[0].hops, *path);
80758075
},
80768076
_ => panic!("Unexpected event"),
80778077
}
80788078
match events[2] {
80798079
Event::PaymentPathSuccessful { payment_id: ref actual_payment_id, ref payment_hash, ref path } => {
80808080
assert_eq!(payment_id, *actual_payment_id);
80818081
assert_eq!(our_payment_hash, *payment_hash.as_ref().unwrap());
8082-
assert_eq!(route.paths[0], *path);
8082+
assert_eq!(route.paths[0].hops, *path);
80838083
},
80848084
_ => panic!("Unexpected event"),
80858085
}
@@ -8283,12 +8283,12 @@ mod tests {
82838283
let (mut route, payment_hash, _, _) = get_route_and_payment_hash!(&nodes[0], nodes[3], 100000);
82848284
let path = route.paths[0].clone();
82858285
route.paths.push(path);
8286-
route.paths[0][0].pubkey = nodes[1].node.get_our_node_id();
8287-
route.paths[0][0].short_channel_id = chan_1_id;
8288-
route.paths[0][1].short_channel_id = chan_3_id;
8289-
route.paths[1][0].pubkey = nodes[2].node.get_our_node_id();
8290-
route.paths[1][0].short_channel_id = chan_2_id;
8291-
route.paths[1][1].short_channel_id = chan_4_id;
8286+
route.paths[0].hops[0].pubkey = nodes[1].node.get_our_node_id();
8287+
route.paths[0].hops[0].short_channel_id = chan_1_id;
8288+
route.paths[0].hops[1].short_channel_id = chan_3_id;
8289+
route.paths[1].hops[0].pubkey = nodes[2].node.get_our_node_id();
8290+
route.paths[1].hops[0].short_channel_id = chan_2_id;
8291+
route.paths[1].hops[1].short_channel_id = chan_4_id;
82928292

82938293
match nodes[0].node.send_payment(&route, payment_hash, &None, PaymentId(payment_hash.0)).unwrap_err() {
82948294
PaymentSendFailure::ParameterError(APIError::APIMisuseError { ref err }) => {

lightning/src/ln/functional_tests.rs

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ use crate::ln::channel::{Channel, ChannelError};
2525
use crate::ln::{chan_utils, onion_utils};
2626
use crate::ln::chan_utils::{OFFERED_HTLC_SCRIPT_WEIGHT, htlc_success_tx_weight, htlc_timeout_tx_weight, HTLCOutputInCommitment};
2727
use crate::routing::gossip::{NetworkGraph, NetworkUpdate};
28-
use crate::routing::router::{PaymentParameters, Route, RouteHop, RouteParameters, find_route, get_route};
28+
use crate::routing::router::{Path, PaymentParameters, Route, RouteHop, RouteParameters, find_route, get_route};
2929
use crate::ln::features::{ChannelFeatures, NodeFeatures};
3030
use crate::ln::msgs;
3131
use crate::ln::msgs::{ChannelMessageHandler, RoutingMessageHandler, ErrorAction};
@@ -1035,7 +1035,7 @@ fn fake_network_test() {
10351035
});
10361036
hops[1].fee_msat = chan_4.1.contents.fee_base_msat as u64 + chan_4.1.contents.fee_proportional_millionths as u64 * hops[2].fee_msat as u64 / 1000000;
10371037
hops[0].fee_msat = chan_3.0.contents.fee_base_msat as u64 + chan_3.0.contents.fee_proportional_millionths as u64 * hops[1].fee_msat as u64 / 1000000;
1038-
let payment_preimage_1 = send_along_route(&nodes[1], Route { paths: vec![hops], payment_params: None }, &vec!(&nodes[2], &nodes[3], &nodes[1])[..], 1000000).0;
1038+
let payment_preimage_1 = send_along_route(&nodes[1], Route { paths: vec![Path { hops, blinded_tail: None }], payment_params: None }, &vec!(&nodes[2], &nodes[3], &nodes[1])[..], 1000000).0;
10391039

10401040
let mut hops = Vec::with_capacity(3);
10411041
hops.push(RouteHop {
@@ -1064,7 +1064,7 @@ fn fake_network_test() {
10641064
});
10651065
hops[1].fee_msat = chan_2.1.contents.fee_base_msat as u64 + chan_2.1.contents.fee_proportional_millionths as u64 * hops[2].fee_msat as u64 / 1000000;
10661066
hops[0].fee_msat = chan_3.1.contents.fee_base_msat as u64 + chan_3.1.contents.fee_proportional_millionths as u64 * hops[1].fee_msat as u64 / 1000000;
1067-
let payment_hash_2 = send_along_route(&nodes[1], Route { paths: vec![hops], payment_params: None }, &vec!(&nodes[3], &nodes[2], &nodes[1])[..], 1000000).1;
1067+
let payment_hash_2 = send_along_route(&nodes[1], Route { paths: vec![Path { hops, blinded_tail: None }], payment_params: None }, &vec!(&nodes[3], &nodes[2], &nodes[1])[..], 1000000).1;
10681068

10691069
// Claim the rebalances...
10701070
fail_payment(&nodes[1], &vec!(&nodes[3], &nodes[2], &nodes[1])[..], payment_hash_2);
@@ -1805,7 +1805,7 @@ fn test_channel_reserve_holding_cell_htlcs() {
18051805
let payment_params = PaymentParameters::from_node_id(nodes[2].node.get_our_node_id(), TEST_FINAL_CLTV)
18061806
.with_features(nodes[2].node.invoice_features()).with_max_channel_saturation_power_of_half(0);
18071807
let (mut route, our_payment_hash, _, our_payment_secret) = get_route_and_payment_hash!(nodes[0], nodes[2], payment_params, recv_value_0, TEST_FINAL_CLTV);
1808-
route.paths[0].last_mut().unwrap().fee_msat += 1;
1808+
route.paths[0].hops.last_mut().unwrap().fee_msat += 1;
18091809
assert!(route.paths[0].iter().rev().skip(1).all(|h| h.fee_msat == feemsat));
18101810

18111811
unwrap_send_err!(nodes[0].node.send_payment(&route, our_payment_hash, &Some(our_payment_secret), PaymentId(our_payment_hash.0)), true, APIError::ChannelUnavailable { ref err },
@@ -5697,7 +5697,7 @@ fn test_fail_holding_cell_htlc_upon_free() {
56975697
assert_eq!(PaymentId(our_payment_hash.0), *payment_id.as_ref().unwrap());
56985698
assert_eq!(our_payment_hash.clone(), *payment_hash);
56995699
assert_eq!(*payment_failed_permanently, false);
5700-
assert_eq!(*short_channel_id, Some(route.paths[0][0].short_channel_id));
5700+
assert_eq!(*short_channel_id, Some(route.paths[0].hops[0].short_channel_id));
57015701
},
57025702
_ => panic!("Unexpected event"),
57035703
}
@@ -5786,7 +5786,7 @@ fn test_free_and_fail_holding_cell_htlcs() {
57865786
assert_eq!(payment_id_2, *payment_id.as_ref().unwrap());
57875787
assert_eq!(payment_hash_2.clone(), *payment_hash);
57885788
assert_eq!(*payment_failed_permanently, false);
5789-
assert_eq!(*short_channel_id, Some(route_2.paths[0][0].short_channel_id));
5789+
assert_eq!(*short_channel_id, Some(route_2.paths[0].hops[0].short_channel_id));
57905790
},
57915791
_ => panic!("Unexpected event"),
57925792
}
@@ -5982,7 +5982,7 @@ fn test_update_add_htlc_bolt2_sender_value_below_minimum_msat() {
59825982
let _chan = create_announced_chan_between_nodes_with_value(&nodes, 0, 1, 100000, 95000000);
59835983

59845984
let (mut route, our_payment_hash, _, our_payment_secret) = get_route_and_payment_hash!(nodes[0], nodes[1], 100000);
5985-
route.paths[0][0].fee_msat = 100;
5985+
route.paths[0].hops[0].fee_msat = 100;
59865986

59875987
unwrap_send_err!(nodes[0].node.send_payment(&route, our_payment_hash, &Some(our_payment_secret), PaymentId(our_payment_hash.0)), true, APIError::ChannelUnavailable { ref err },
59885988
assert!(regex::Regex::new(r"Cannot send less than their minimum HTLC value \(\d+\)").unwrap().is_match(err)));
@@ -6000,7 +6000,7 @@ fn test_update_add_htlc_bolt2_sender_zero_value_msat() {
60006000
let _chan = create_announced_chan_between_nodes_with_value(&nodes, 0, 1, 100000, 95000000);
60016001

60026002
let (mut route, our_payment_hash, _, our_payment_secret) = get_route_and_payment_hash!(nodes[0], nodes[1], 100000);
6003-
route.paths[0][0].fee_msat = 0;
6003+
route.paths[0].hops[0].fee_msat = 0;
60046004
unwrap_send_err!(nodes[0].node.send_payment(&route, our_payment_hash, &Some(our_payment_secret), PaymentId(our_payment_hash.0)), true, APIError::ChannelUnavailable { ref err },
60056005
assert_eq!(err, "Cannot send 0-msat HTLC"));
60066006

@@ -6043,7 +6043,7 @@ fn test_update_add_htlc_bolt2_sender_cltv_expiry_too_high() {
60436043
let payment_params = PaymentParameters::from_node_id(nodes[1].node.get_our_node_id(), 0)
60446044
.with_features(nodes[1].node.invoice_features());
60456045
let (mut route, our_payment_hash, _, our_payment_secret) = get_route_and_payment_hash!(nodes[0], nodes[1], payment_params, 100000000, 0);
6046-
route.paths[0].last_mut().unwrap().cltv_expiry_delta = 500000001;
6046+
route.paths[0].hops.last_mut().unwrap().cltv_expiry_delta = 500000001;
60476047
unwrap_send_err!(nodes[0].node.send_payment(&route, our_payment_hash, &Some(our_payment_secret), PaymentId(our_payment_hash.0)), true, APIError::InvalidRoute { ref err },
60486048
assert_eq!(err, &"Channel CLTV overflowed?"));
60496049
}
@@ -6107,7 +6107,7 @@ fn test_update_add_htlc_bolt2_sender_exceed_max_htlc_value_in_flight() {
61076107
let (mut route, our_payment_hash, _, our_payment_secret) = get_route_and_payment_hash!(nodes[0], nodes[1], max_in_flight);
61086108
// Manually create a route over our max in flight (which our router normally automatically
61096109
// limits us to.
6110-
route.paths[0][0].fee_msat = max_in_flight + 1;
6110+
route.paths[0].hops[0].fee_msat = max_in_flight + 1;
61116111
unwrap_send_err!(nodes[0].node.send_payment(&route, our_payment_hash, &Some(our_payment_secret), PaymentId(our_payment_hash.0)), true, APIError::ChannelUnavailable { ref err },
61126112
assert!(regex::Regex::new(r"Cannot send value that would put us over the max HTLC value in flight our peer will accept \(\d+\)").unwrap().is_match(err)));
61136113

@@ -7578,7 +7578,7 @@ fn test_pending_claimed_htlc_no_balance_underflow() {
75787578
// almost-claimed HTLC as available balance.
75797579
let (mut route, _, _, _) = get_route_and_payment_hash!(nodes[0], nodes[1], 10_000);
75807580
route.payment_params = None; // This is all wrong, but unnecessary
7581-
route.paths[0][0].pubkey = nodes[0].node.get_our_node_id();
7581+
route.paths[0].hops[0].pubkey = nodes[0].node.get_our_node_id();
75827582
let (_, payment_hash_2, payment_secret_2) = get_payment_preimage_hash!(nodes[0]);
75837583
nodes[1].node.send_payment(&route, payment_hash_2, &Some(payment_secret_2), PaymentId(payment_hash_2.0)).unwrap();
75847584

@@ -7941,12 +7941,12 @@ fn test_simple_mpp() {
79417941
let (mut route, payment_hash, payment_preimage, payment_secret) = get_route_and_payment_hash!(&nodes[0], nodes[3], 100000);
79427942
let path = route.paths[0].clone();
79437943
route.paths.push(path);
7944-
route.paths[0][0].pubkey = nodes[1].node.get_our_node_id();
7945-
route.paths[0][0].short_channel_id = chan_1_id;
7946-
route.paths[0][1].short_channel_id = chan_3_id;
7947-
route.paths[1][0].pubkey = nodes[2].node.get_our_node_id();
7948-
route.paths[1][0].short_channel_id = chan_2_id;
7949-
route.paths[1][1].short_channel_id = chan_4_id;
7944+
route.paths[0].hops[0].pubkey = nodes[1].node.get_our_node_id();
7945+
route.paths[0].hops[0].short_channel_id = chan_1_id;
7946+
route.paths[0].hops[1].short_channel_id = chan_3_id;
7947+
route.paths[1].hops[0].pubkey = nodes[2].node.get_our_node_id();
7948+
route.paths[1].hops[0].short_channel_id = chan_2_id;
7949+
route.paths[1].hops[1].short_channel_id = chan_4_id;
79507950
send_along_route_with_secret(&nodes[0], route, &[&[&nodes[1], &nodes[3]], &[&nodes[2], &nodes[3]]], 200_000, payment_hash, payment_secret);
79517951
claim_payment_along_route(&nodes[0], &[&[&nodes[1], &nodes[3]], &[&nodes[2], &nodes[3]]], false, payment_preimage);
79527952
}
@@ -9127,7 +9127,7 @@ fn test_inconsistent_mpp_params() {
91279127
assert_eq!(route.paths.len(), 2);
91289128
route.paths.sort_by(|path_a, _| {
91299129
// Sort the path so that the path through nodes[1] comes first
9130-
if path_a[0].pubkey == nodes[1].node.get_our_node_id() {
9130+
if path_a.hops[0].pubkey == nodes[1].node.get_our_node_id() {
91319131
core::cmp::Ordering::Less } else { core::cmp::Ordering::Greater }
91329132
});
91339133

@@ -9314,7 +9314,7 @@ fn test_double_partial_claim() {
93149314
assert_eq!(route.paths.len(), 2);
93159315
route.paths.sort_by(|path_a, _| {
93169316
// Sort the path so that the path through nodes[1] comes first
9317-
if path_a[0].pubkey == nodes[1].node.get_our_node_id() {
9317+
if path_a.hops[0].pubkey == nodes[1].node.get_our_node_id() {
93189318
core::cmp::Ordering::Less } else { core::cmp::Ordering::Greater }
93199319
});
93209320

0 commit comments

Comments
 (0)