Correct default value for A* heuristic for non-public nodes
authorMatt Corallo <git@bluematt.me>
Thu, 10 Feb 2022 21:33:26 +0000 (21:33 +0000)
committerMatt Corallo <git@bluematt.me>
Mon, 28 Feb 2022 22:07:54 +0000 (22:07 +0000)
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

index c3b042825971e1c2ce917881508c30c235d764ed..ff430a288252e46b5d4ec62fb3ab7fc1d2d21871 100644 (file)
@@ -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;