diff --git a/mutiny-core/src/lsp/mod.rs b/mutiny-core/src/lsp/mod.rs index f076de110..5899f399e 100644 --- a/mutiny-core/src/lsp/mod.rs +++ b/mutiny-core/src/lsp/mod.rs @@ -163,6 +163,10 @@ impl AnyLsp { AnyLsp::Lsps(_) => true, } } + + pub fn is_lsps(&self) -> bool { + matches!(self, AnyLsp::Lsps(_)) + } } #[cfg_attr(target_arch = "wasm32", async_trait(?Send))] diff --git a/mutiny-core/src/node.rs b/mutiny-core/src/node.rs index 5b1147bd3..c7c32b149 100644 --- a/mutiny-core/src/node.rs +++ b/mutiny-core/src/node.rs @@ -1066,7 +1066,7 @@ impl Node { let min_amount_sat = if has_inbound_capacity { 1 } else { - utils::min_lightning_amount(self.network) + utils::min_lightning_amount(self.network, lsp.is_lsps()) }; if amount_sat < min_amount_sat { @@ -1117,7 +1117,7 @@ impl Node { let min_amount_sat = if has_inbound_capacity { 1 } else { - utils::min_lightning_amount(self.network) + utils::min_lightning_amount(self.network, lsp.is_lsps()) }; if amount_sat < min_amount_sat { diff --git a/mutiny-core/src/utils.rs b/mutiny-core/src/utils.rs index a65c26ee6..63c1a9896 100644 --- a/mutiny-core/src/utils.rs +++ b/mutiny-core/src/utils.rs @@ -23,7 +23,10 @@ use std::str::FromStr; pub const FETCH_TIMEOUT: i32 = 30_000; -pub(crate) fn min_lightning_amount(network: Network) -> u64 { +pub(crate) fn min_lightning_amount(network: Network, is_lsps: bool) -> u64 { + if is_lsps { + return 1; + } match network { Network::Bitcoin => 100_000, Network::Testnet | Network::Signet | Network::Regtest => 10_000,