@@ -846,11 +846,8 @@ where L::Target: Logger {
846
846
let mut used_channel_liquidities: HashMap < ( u64 , bool ) , u64 > =
847
847
HashMap :: with_capacity ( network_nodes. len ( ) ) ;
848
848
849
- // Keeping track of how much value we already collected across other paths. Helps to decide:
850
- // - how much a new path should be transferring (upper bound);
851
- // - whether a channel should be disregarded because
852
- // it's available liquidity is too small comparing to how much more we need to collect;
853
- // - when we want to stop looking for new paths.
849
+ // Keeping track of how much value we already collected across other paths. Helps to decide
850
+ // when we want to stop looking for new paths.
854
851
let mut already_collected_value_msat = 0 ;
855
852
856
853
for ( _, channels) in first_hop_targets. iter_mut ( ) {
@@ -919,16 +916,12 @@ where L::Target: Logger {
919
916
// Taking too many smaller paths also increases the chance of payment failure.
920
917
// Thus to avoid this effect, we require from our collected links to provide
921
918
// at least a minimal contribution to the recommended value yet-to-be-fulfilled.
922
- //
923
- // This requirement is currently 5% of the remaining-to-be-collected value.
924
- // This means as we successfully advance in our collection,
925
- // the absolute liquidity contribution is lowered,
926
- // thus increasing the number of potential channels to be selected.
919
+ // This requirement is currently 10% of the value.
927
920
928
- // Derive the minimal liquidity contribution with a ratio of 20 (5 %, rounded up)
921
+ // Derive the minimal liquidity contribution with a ratio of 10 (10 %, rounded up)
929
922
// or 100% if we're not allowed to do multipath payments.
930
923
let minimal_value_contribution_msat: u64 = if allow_mpp {
931
- ( recommended_value_msat - already_collected_value_msat + 19 ) / 20
924
+ ( final_value_msat + 9 ) / 10
932
925
} else {
933
926
final_value_msat
934
927
} ;
@@ -1503,10 +1496,8 @@ where L::Target: Logger {
1503
1496
* used_channel_liquidities. entry ( ( victim_scid, true ) ) . or_default ( ) = exhausted;
1504
1497
}
1505
1498
1506
- // Track the total amount all our collected paths allow to send so that we:
1507
- // - know when to stop looking for more paths
1508
- // - know which of the hops are useless considering how much more sats we need
1509
- // (contributes_sufficient_value)
1499
+ // Track the total amount all our collected paths allow to send so that we know
1500
+ // when to stop looking for more paths
1510
1501
already_collected_value_msat += value_contribution_msat;
1511
1502
1512
1503
payment_paths. push ( payment_path) ;
0 commit comments