Skip to content

Commit 77f2ce8

Browse files
committed
Don't listen by default
As we expect LDK Node to be primarily used as a client, we should be conservative about listening/accepting inbound connections. The user should make a dedicated choice to do so.
1 parent e8b7cca commit 77f2ce8

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/lib.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@ uniffi::include_scaffolding!("ldk_node");
161161
// Config defaults
162162
const DEFAULT_STORAGE_DIR_PATH: &str = "/tmp/ldk_node/";
163163
const DEFAULT_NETWORK: Network = Network::Bitcoin;
164-
const DEFAULT_LISTENING_ADDR: &str = "0.0.0.0:9735";
165164
const DEFAULT_CLTV_EXPIRY_DELTA: u32 = 144;
166165
const DEFAULT_BDK_WALLET_SYNC_INTERVAL_SECS: u64 = 80;
167166
const DEFAULT_LDK_WALLET_SYNC_INTERVAL_SECS: u64 = 30;
@@ -204,14 +203,14 @@ const WALLET_KEYS_SEED_LEN: usize = 64;
204203
/// | Parameter | Value |
205204
/// |----------------------------------------|------------------|
206205
/// | `storage_dir_path` | /tmp/ldk_node/ |
207-
/// | `network` | `Bitcoin |
208-
/// | `listening_address` | 0.0.0.0:9735 |
206+
/// | `network` | Bitcoin |
207+
/// | `listening_address` | None |
209208
/// | `default_cltv_expiry_delta` | 144 |
210-
/// | `onchain_wallet_sync_interval_secs` | 60 |
211-
/// | `wallet_sync_interval_secs` | 20 |
209+
/// | `onchain_wallet_sync_interval_secs` | 80 |
210+
/// | `wallet_sync_interval_secs` | 30 |
212211
/// | `fee_rate_cache_update_interval_secs` | 600 |
213212
/// | `trusted_peers_0conf` | [] |
214-
/// | `log_level` | `Debug` |
213+
/// | `log_level` | Debug |
215214
///
216215
pub struct Config {
217216
/// The path where the underlying LDK and BDK persist their data.
@@ -251,7 +250,7 @@ impl Default for Config {
251250
Self {
252251
storage_dir_path: DEFAULT_STORAGE_DIR_PATH.to_string(),
253252
network: DEFAULT_NETWORK,
254-
listening_address: Some(DEFAULT_LISTENING_ADDR.parse().unwrap()),
253+
listening_address: None,
255254
default_cltv_expiry_delta: DEFAULT_CLTV_EXPIRY_DELTA,
256255
onchain_wallet_sync_interval_secs: DEFAULT_BDK_WALLET_SYNC_INTERVAL_SECS,
257256
wallet_sync_interval_secs: DEFAULT_LDK_WALLET_SYNC_INTERVAL_SECS,

0 commit comments

Comments
 (0)