From: Jeffrey Czyz Date: Tue, 25 Jan 2022 17:07:00 +0000 (-0600) Subject: f - Include fees when calculating cost X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=888254b5564995a66f6daddd4df3793f8621dd82;p=rust-lightning f - Include fees when calculating cost --- 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 } }