From bd1b761655f549daee6b5d2920227ab7bd493b89 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Thu, 10 Feb 2022 21:33:26 +0000 Subject: [PATCH] Correct default value for A* heuristic for non-public nodes This doesn't (appear) to change behavior, however if we have a non-public node, we assign an A* heuristic of max-u32 fees, which may result in us de-prioritizing the path in some rare cases around multi-hop route hints which compete with public nodes. --- lightning/src/routing/router.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lightning/src/routing/router.rs b/lightning/src/routing/router.rs index c3b04282..ff430a28 100644 --- a/lightning/src/routing/router.rs +++ b/lightning/src/routing/router.rs @@ -876,8 +876,8 @@ where L::Target: Logger { // semi-dummy record just to compute the fees to reach the source node. // This will affect our decision on selecting short_channel_id // as a way to reach the $dest_node_id. - let mut fee_base_msat = u32::max_value(); - let mut fee_proportional_millionths = u32::max_value(); + let mut fee_base_msat = 0; + let mut fee_proportional_millionths = 0; if let Some(Some(fees)) = network_nodes.get(&$src_node_id).map(|node| node.lowest_inbound_channel_fees) { fee_base_msat = fees.base_msat; fee_proportional_millionths = fees.proportional_millionths; -- 2.30.2