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