Skip to content

Commit b1791f4

Browse files
f don't use default amount
1 parent 698527b commit b1791f4

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

lightning/src/routing/router.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,6 @@ impl<G: Deref<Target = NetworkGraph<L>>, L: Deref, ES: Deref, S: Deref, SP: Size
104104
// recipient's node_id.
105105
const MIN_PEER_CHANNELS: usize = 3;
106106

107-
const DEFAULT_AMT_MSAT: u64 = 100_000_000;
108-
let amount_msats = amount_msats.unwrap_or(DEFAULT_AMT_MSAT);
109-
110107
let has_one_peer = first_hops
111108
.first()
112109
.map(|details| details.counterparty.node_id)
@@ -123,9 +120,9 @@ impl<G: Deref<Target = NetworkGraph<L>>, L: Deref, ES: Deref, S: Deref, SP: Size
123120

124121
let paths = first_hops.into_iter()
125122
.filter(|details| details.counterparty.features.supports_route_blinding())
126-
.filter(|details| amount_msats <= details.inbound_capacity_msat)
127-
.filter(|details| amount_msats >= details.inbound_htlc_minimum_msat.unwrap_or(0))
128-
.filter(|details| amount_msats <= details.inbound_htlc_maximum_msat.unwrap_or(u64::MAX))
123+
.filter(|details| amount_msats.unwrap_or(0) <= details.inbound_capacity_msat)
124+
.filter(|details| amount_msats.unwrap_or(u64::MAX) >= details.inbound_htlc_minimum_msat.unwrap_or(0))
125+
.filter(|details| amount_msats.unwrap_or(0) <= details.inbound_htlc_maximum_msat.unwrap_or(u64::MAX))
129126
// Limit to peers with announced channels unless the recipient is unannounced.
130127
.filter(|details| network_graph
131128
.node(&NodeId::from_pubkey(&details.counterparty.node_id))

0 commit comments

Comments
 (0)