Allow routefinding again due to HTLC limit based on >= not >
authorMatt Corallo <git@bluematt.me>
Thu, 28 Sep 2023 18:19:50 +0000 (18:19 +0000)
committerMatt Corallo <git@bluematt.me>
Thu, 28 Sep 2023 20:39:36 +0000 (20:39 +0000)
While this doesn't matter much in practice, if we go around again
when route-finding to try to meet an htlc_minimum_msat, we use the
`recommended_value_msat` which can work if we meet the
`htlc_minimum_msat` on a channel exactly, so using >= rather than >
can capture cases with 1msat more.

lightning/src/routing/router.rs

index 193fe35233408e0c20946139faa547f374951ab1..1c51bb985e94e28bc807baa55f87678302c25faf 100644 (file)
@@ -1788,9 +1788,9 @@ where L::Target: Logger {
                                        #[allow(unused_comparisons)] // $next_hops_path_htlc_minimum_msat is 0 in some calls so rustc complains
                                        let may_overpay_to_meet_path_minimum_msat =
                                                ((amount_to_transfer_over_msat < $candidate.htlc_minimum_msat() &&
-                                                 recommended_value_msat > $candidate.htlc_minimum_msat()) ||
+                                                 recommended_value_msat >= $candidate.htlc_minimum_msat()) ||
                                                 (amount_to_transfer_over_msat < $next_hops_path_htlc_minimum_msat &&
-                                                 recommended_value_msat > $next_hops_path_htlc_minimum_msat));
+                                                 recommended_value_msat >= $next_hops_path_htlc_minimum_msat));
 
                                        let payment_failed_on_this_channel = scid_opt.map_or(false,
                                                |scid| payment_params.previously_failed_channels.contains(&scid));