From: Matt Corallo Date: Thu, 10 Feb 2022 21:33:26 +0000 (+0000) Subject: Correct default value for A* heuristic for non-public nodes X-Git-Tag: v0.0.105^2~2^2 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=bd1b761655f549daee6b5d2920227ab7bd493b89;p=rust-lightning 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. --- diff --git a/lightning/src/routing/router.rs b/lightning/src/routing/router.rs index c3b042825..ff430a288 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;