Don't consider a path as having hit HTLC-min if it isn't sufficient
[rust-lightning] / lightning / src / routing / router.rs
index fbdefb9840a80d4c38ebc32007e8b39ab6d31ed8..8a4d8a0db341610e82374e1dad92ebaac9470c90 100644 (file)
@@ -917,7 +917,7 @@ where L::Target: Logger {
                                        // Since we're choosing amount_to_transfer_over_msat as maximum possible, it can
                                        // be only reduced later (not increased), so this channel should just be skipped
                                        // as not sufficient.
-                                       if !over_path_minimum_msat && doesnt_exceed_cltv_delta_limit {
+                                       if contributes_sufficient_value && !over_path_minimum_msat && doesnt_exceed_cltv_delta_limit {
                                                hit_minimum_limit = true;
                                        } else if contributes_sufficient_value && doesnt_exceed_cltv_delta_limit {
                                                // Note that low contribution here (limited by available_liquidity_msat)