Skip to content

Commit 29b2776

Browse files
committed
f missing conversions to new field
1 parent d91d4a5 commit 29b2776

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

lightning/src/routing/router.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,8 @@ where L::Target: Logger {
818818
// We don't want multiple paths (as per MPP) share liquidity of the same channels.
819819
// This map allows paths to be aware of the channel use by other paths in the same call.
820820
// This would help to make a better path finding decisions and not "overbook" channels.
821-
// It is unaware of the directions (except for `outbound_capacity_msat` in `first_hops`).
821+
// It is unaware of the directions (except for `next_outbound_htlc_limit_msat` in
822+
// `first_hops`).
822823
let mut bookkept_channels_liquidity_available_msat = HashMap::with_capacity(network_nodes.len());
823824

824825
// Keeping track of how much value we already collected across other paths. Helps to decide:
@@ -841,12 +842,12 @@ where L::Target: Logger {
841842
// sort channels above `recommended_value_msat` in ascending order, preferring channels
842843
// which have enough, but not too much, capacity for the payment.
843844
channels.sort_unstable_by(|chan_a, chan_b| {
844-
if chan_b.outbound_capacity_msat < recommended_value_msat || chan_a.outbound_capacity_msat < recommended_value_msat {
845+
if chan_b.next_outbound_htlc_limit_msat < recommended_value_msat || chan_a.next_outbound_htlc_limit_msat < recommended_value_msat {
845846
// Sort in descending order
846-
chan_b.outbound_capacity_msat.cmp(&chan_a.outbound_capacity_msat)
847+
chan_b.next_outbound_htlc_limit_msat.cmp(&chan_a.next_outbound_htlc_limit_msat)
847848
} else {
848849
// Sort in ascending order
849-
chan_a.outbound_capacity_msat.cmp(&chan_b.outbound_capacity_msat)
850+
chan_a.next_outbound_htlc_limit_msat.cmp(&chan_b.next_outbound_htlc_limit_msat)
850851
}
851852
});
852853
}
@@ -3404,7 +3405,7 @@ mod tests {
34043405
assert_eq!(path.last().unwrap().fee_msat, 250_000_000);
34053406
}
34063407

3407-
// Check that setting outbound_capacity_msat in first_hops limits the channels.
3408+
// Check that setting next_outbound_htlc_limit_msat in first_hops limits the channels.
34083409
// Disable channel #1 and use another first hop.
34093410
update_channel(&net_graph_msg_handler, &secp_ctx, &our_privkey, UnsignedChannelUpdate {
34103411
chain_hash: genesis_block(Network::Testnet).header.block_hash(),
@@ -3419,7 +3420,7 @@ mod tests {
34193420
excess_data: Vec::new()
34203421
});
34213422

3422-
// Now, limit the first_hop by the outbound_capacity_msat of 200_000 sats.
3423+
// Now, limit the first_hop by the next_outbound_htlc_limit_msat of 200_000 sats.
34233424
let our_chans = vec![get_channel_details(Some(42), nodes[0].clone(), InitFeatures::from_le_bytes(vec![0b11]), 200_000_000)];
34243425

34253426
{

0 commit comments

Comments
 (0)