From 642240e867c1f89134f7eeb5275231562f40e344 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Fri, 15 Dec 2023 22:32:24 +0000 Subject: [PATCH] Use correct default value when comparing to `htlc_maximum_msat` 62f866965436fff1a8e98ee655a8a6dcbb8716c1 added two `htlc_maximum_msat.unwrap_or`s, but used a default value of 0, spuriously causing all HTLCs to fail if we don't have an htlc maximum value. This should be mostly harmless, but we should fix it anyway. --- 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 86c428410..2359c8372 100644 --- a/lightning/src/routing/router.rs +++ b/lightning/src/routing/router.rs @@ -102,7 +102,7 @@ impl> + Clone, L: Deref, S: Deref, SP: Sized, .filter(|details| details.counterparty.features.supports_route_blinding()) .filter(|details| amount_msats <= details.inbound_capacity_msat) .filter(|details| amount_msats >= details.inbound_htlc_minimum_msat.unwrap_or(0)) - .filter(|details| amount_msats <= details.inbound_htlc_maximum_msat.unwrap_or(0)) + .filter(|details| amount_msats <= details.inbound_htlc_maximum_msat.unwrap_or(u64::MAX)) .filter(|details| network_graph .node(&NodeId::from_pubkey(&details.counterparty.node_id)) .map(|node_info| node_info.channels.len() >= MIN_PEER_CHANNELS) @@ -139,7 +139,7 @@ impl> + Clone, L: Deref, S: Deref, SP: Sized, features: BlindedHopFeatures::empty(), }, node_id: details.counterparty.node_id, - htlc_maximum_msat: details.inbound_htlc_maximum_msat.unwrap_or(0), + htlc_maximum_msat: details.inbound_htlc_maximum_msat.unwrap_or(u64::MAX), }) }) .map(|forward_node| { -- 2.39.5