From 888254b5564995a66f6daddd4df3793f8621dd82 Mon Sep 17 00:00:00 2001 From: Jeffrey Czyz Date: Tue, 25 Jan 2022 11:07:00 -0600 Subject: [PATCH] f - Include fees when calculating cost --- lightning/src/routing/scoring.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lightning/src/routing/scoring.rs b/lightning/src/routing/scoring.rs index 7d5689275..915be8bdd 100644 --- a/lightning/src/routing/scoring.rs +++ b/lightning/src/routing/scoring.rs @@ -417,7 +417,7 @@ impl Score for ScorerUsingTime { .unwrap_or(u64::max_value()); } - penalty_msat + params.fees_msat.checked_add(penalty_msat).unwrap_or(u64::max_value()) } fn payment_path_failed(&mut self, _path: &[&RouteHop], short_channel_id: u64) { @@ -761,9 +761,9 @@ impl, T: Time> Score for ProbabilisticScorerUsin if success_probability == 0.0 { u64::max_value() } else if success_probability == 1.0 { - 0 + params.fees_msat } else { - (-(success_probability.log10()) * liquidity_penalty_multiplier_msat as f64) as u64 + params.fees_msat + (-(success_probability.log10()) * liquidity_penalty_multiplier_msat as f64) as u64 } } -- 2.39.5