Skip to content

Commit 642240e

Browse files
committed
Use correct default value when comparing to htlc_maximum_msat
62f8669 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.
1 parent bb0ddad commit 642240e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lightning/src/routing/router.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ impl<G: Deref<Target = NetworkGraph<L>> + Clone, L: Deref, S: Deref, SP: Sized,
102102
.filter(|details| details.counterparty.features.supports_route_blinding())
103103
.filter(|details| amount_msats <= details.inbound_capacity_msat)
104104
.filter(|details| amount_msats >= details.inbound_htlc_minimum_msat.unwrap_or(0))
105-
.filter(|details| amount_msats <= details.inbound_htlc_maximum_msat.unwrap_or(0))
105+
.filter(|details| amount_msats <= details.inbound_htlc_maximum_msat.unwrap_or(u64::MAX))
106106
.filter(|details| network_graph
107107
.node(&NodeId::from_pubkey(&details.counterparty.node_id))
108108
.map(|node_info| node_info.channels.len() >= MIN_PEER_CHANNELS)
@@ -139,7 +139,7 @@ impl<G: Deref<Target = NetworkGraph<L>> + Clone, L: Deref, S: Deref, SP: Sized,
139139
features: BlindedHopFeatures::empty(),
140140
},
141141
node_id: details.counterparty.node_id,
142-
htlc_maximum_msat: details.inbound_htlc_maximum_msat.unwrap_or(0),
142+
htlc_maximum_msat: details.inbound_htlc_maximum_msat.unwrap_or(u64::MAX),
143143
})
144144
})
145145
.map(|forward_node| {

0 commit comments

Comments
 (0)