@@ -818,7 +818,8 @@ where L::Target: Logger {
818
818
// We don't want multiple paths (as per MPP) share liquidity of the same channels.
819
819
// This map allows paths to be aware of the channel use by other paths in the same call.
820
820
// 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`).
822
823
let mut bookkept_channels_liquidity_available_msat = HashMap :: with_capacity ( network_nodes. len ( ) ) ;
823
824
824
825
// Keeping track of how much value we already collected across other paths. Helps to decide:
@@ -841,12 +842,12 @@ where L::Target: Logger {
841
842
// sort channels above `recommended_value_msat` in ascending order, preferring channels
842
843
// which have enough, but not too much, capacity for the payment.
843
844
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 {
845
846
// 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 )
847
848
} else {
848
849
// 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 )
850
851
}
851
852
} ) ;
852
853
}
@@ -3404,7 +3405,7 @@ mod tests {
3404
3405
assert_eq ! ( path. last( ) . unwrap( ) . fee_msat, 250_000_000 ) ;
3405
3406
}
3406
3407
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.
3408
3409
// Disable channel #1 and use another first hop.
3409
3410
update_channel ( & net_graph_msg_handler, & secp_ctx, & our_privkey, UnsignedChannelUpdate {
3410
3411
chain_hash : genesis_block ( Network :: Testnet ) . header . block_hash ( ) ,
@@ -3419,7 +3420,7 @@ mod tests {
3419
3420
excess_data : Vec :: new ( )
3420
3421
} ) ;
3421
3422
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.
3423
3424
let our_chans = vec ! [ get_channel_details( Some ( 42 ) , nodes[ 0 ] . clone( ) , InitFeatures :: from_le_bytes( vec![ 0b11 ] ) , 200_000_000 ) ] ;
3424
3425
3425
3426
{
0 commit comments