Skip to content

Commit b282d42

Browse files
committed
Drop default_cltv_expiry_delta
.. as it was used for spontaneous payments only and hence a bit misleading. We drop it for now and see if any users would complain. If so, it would probably be sufficient for it to be an optional parameter on the spontaneous payments methods.
1 parent 8a432b1 commit b282d42

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

bindings/ldk_node.udl

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ dictionary Config {
88
string? log_dir_path;
99
Network network;
1010
sequence<SocketAddress>? listening_addresses;
11-
u32 default_cltv_expiry_delta;
1211
u64 onchain_wallet_sync_interval_secs;
1312
u64 wallet_sync_interval_secs;
1413
u64 fee_rate_cache_update_interval_secs;

src/config.rs

-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ use std::time::Duration;
1212
// Config defaults
1313
const DEFAULT_STORAGE_DIR_PATH: &str = "/tmp/ldk_node/";
1414
const DEFAULT_NETWORK: Network = Network::Bitcoin;
15-
const DEFAULT_CLTV_EXPIRY_DELTA: u32 = 144;
1615
const DEFAULT_BDK_WALLET_SYNC_INTERVAL_SECS: u64 = 80;
1716
const DEFAULT_LDK_WALLET_SYNC_INTERVAL_SECS: u64 = 30;
1817
const DEFAULT_FEE_RATE_CACHE_UPDATE_INTERVAL_SECS: u64 = 60 * 10;
@@ -105,8 +104,6 @@ pub struct Config {
105104
pub network: Network,
106105
/// The addresses on which the node will listen for incoming connections.
107106
pub listening_addresses: Option<Vec<SocketAddress>>,
108-
/// The default CLTV expiry delta to be used for payments.
109-
pub default_cltv_expiry_delta: u32,
110107
/// The time in-between background sync attempts of the onchain wallet, in seconds.
111108
///
112109
/// **Note:** A minimum of 10 seconds is always enforced.
@@ -168,7 +165,6 @@ impl Default for Config {
168165
log_dir_path: None,
169166
network: DEFAULT_NETWORK,
170167
listening_addresses: None,
171-
default_cltv_expiry_delta: DEFAULT_CLTV_EXPIRY_DELTA,
172168
onchain_wallet_sync_interval_secs: DEFAULT_BDK_WALLET_SYNC_INTERVAL_SECS,
173169
wallet_sync_interval_secs: DEFAULT_LDK_WALLET_SYNC_INTERVAL_SECS,
174170
fee_rate_cache_update_interval_secs: DEFAULT_FEE_RATE_CACHE_UPDATE_INTERVAL_SECS,

src/payment/spontaneous.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ use bitcoin::secp256k1::PublicKey;
1818

1919
use std::sync::{Arc, RwLock};
2020

21+
// The default `final_cltv_expiry_delta` we apply when not set.
22+
const LDK_DEFAULT_FINAL_CLTV_EXPIRY_DELTA: u32 = 144;
23+
2124
/// A payment handler allowing to send spontaneous ("keysend") payments.
2225
///
2326
/// Should be retrieved by calling [`Node::spontaneous_payment`].
@@ -68,7 +71,7 @@ impl SpontaneousPayment {
6871
}
6972

7073
let mut route_params = RouteParameters::from_payment_params_and_value(
71-
PaymentParameters::from_node_id(node_id, self.config.default_cltv_expiry_delta),
74+
PaymentParameters::from_node_id(node_id, LDK_DEFAULT_FINAL_CLTV_EXPIRY_DELTA),
7275
amount_msat,
7376
);
7477

@@ -153,13 +156,12 @@ impl SpontaneousPayment {
153156
}
154157

155158
let liquidity_limit_multiplier = Some(self.config.probing_liquidity_limit_multiplier);
156-
let cltv_expiry_delta = self.config.default_cltv_expiry_delta;
157159

158160
self.channel_manager
159161
.send_spontaneous_preflight_probes(
160162
node_id,
161163
amount_msat,
162-
cltv_expiry_delta,
164+
LDK_DEFAULT_FINAL_CLTV_EXPIRY_DELTA,
163165
liquidity_limit_multiplier,
164166
)
165167
.map_err(|e| {

0 commit comments

Comments
 (0)