@@ -28,6 +28,7 @@ const DEFAULT_LDK_WALLET_SYNC_INTERVAL_SECS: u64 = 30;
2828const DEFAULT_FEE_RATE_CACHE_UPDATE_INTERVAL_SECS : u64 = 60 * 10 ;
2929const DEFAULT_PROBING_LIQUIDITY_LIMIT_MULTIPLIER : u64 = 3 ;
3030const DEFAULT_ANCHOR_PER_CHANNEL_RESERVE_SATS : u64 = 25_000 ;
31+ const DEFAULT_PAYMENT_RETRY_TIMEOUT_SECS : u64 = 10 ;
3132
3233// The default timeout after which we abort a wallet syncing operation.
3334const DEFAULT_BDK_WALLET_SYNC_TIMEOUT_SECS : u64 = 60 ;
@@ -63,9 +64,6 @@ pub(crate) const BDK_CLIENT_STOP_GAP: usize = 20;
6364// The number of concurrent requests made against the API provider.
6465pub ( crate ) const BDK_CLIENT_CONCURRENCY : usize = 4 ;
6566
66- // The timeout after which we abandon retrying failed payments.
67- pub ( crate ) const LDK_PAYMENT_RETRY_TIMEOUT : Duration = Duration :: from_secs ( 10 ) ;
68-
6967// The time in-between peer reconnection attempts.
7068pub ( crate ) const PEER_RECONNECTION_INTERVAL : Duration = Duration :: from_secs ( 60 ) ;
7169
@@ -131,6 +129,7 @@ pub(crate) const LNURL_AUTH_TIMEOUT_SECS: u64 = 15;
131129/// | `probing_liquidity_limit_multiplier` | 3 |
132130/// | `log_level` | Debug |
133131/// | `anchor_channels_config` | Some(..) |
132+ /// | `payment_retry_timeout_secs` | 10 |
134133/// | `route_parameters` | None |
135134///
136135/// See [`AnchorChannelsConfig`] and [`RouteParametersConfig`] for more information regarding their
@@ -188,6 +187,10 @@ pub struct Config {
188187 /// closure. We *will* however still try to get the Anchor spending transactions confirmed
189188 /// on-chain with the funds available.
190189 pub anchor_channels_config : Option < AnchorChannelsConfig > ,
190+ /// The timeout in seconds after which we stop retrying failed payments.
191+ ///
192+ /// When a payment fails to route, LDK will automatically retry until this timeout elapses.
193+ pub payment_retry_timeout_secs : u64 ,
191194 /// Configuration options for payment routing and pathfinding.
192195 ///
193196 /// Setting the [`RouteParametersConfig`] provides flexibility to customize how payments are routed,
@@ -208,6 +211,7 @@ impl Default for Config {
208211 trusted_peers_0conf : Vec :: new ( ) ,
209212 probing_liquidity_limit_multiplier : DEFAULT_PROBING_LIQUIDITY_LIMIT_MULTIPLIER ,
210213 anchor_channels_config : Some ( AnchorChannelsConfig :: default ( ) ) ,
214+ payment_retry_timeout_secs : DEFAULT_PAYMENT_RETRY_TIMEOUT_SECS ,
211215 route_parameters : None ,
212216 node_alias : None ,
213217 }
0 commit comments