@@ -1541,6 +1541,16 @@ pub(super) struct ChannelContext<SP: Deref> where SP::Target: SignerProvider {
1541
1541
/// If we can't release a [`ChannelMonitorUpdate`] until some external action completes, we
1542
1542
/// store it here and only release it to the `ChannelManager` once it asks for it.
1543
1543
blocked_monitor_updates: Vec<PendingChannelMonitorUpdate>,
1544
+
1545
+ /// Upon receving a `FundingSigned` message, if the channel is
1546
+ /// outbound and we are ready to broadcast the funding
1547
+ /// transaction, LDK will broadcast it and set the channel state
1548
+ /// to `ChannelPending`.
1549
+ ///
1550
+ /// Using this flag will allow you to halt the broadcast of the
1551
+ /// funding transaction and the channel state will be set to
1552
+ /// `FundingSigned`.
1553
+ manually_broadcast_outbound_channels: Option<()>,
1544
1554
}
1545
1555
1546
1556
impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
@@ -1872,6 +1882,8 @@ impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
1872
1882
local_initiated_shutdown: None,
1873
1883
1874
1884
blocked_monitor_updates: Vec::new(),
1885
+
1886
+ manually_broadcast_outbound_channels: None,
1875
1887
};
1876
1888
1877
1889
Ok(channel_context)
@@ -2092,6 +2104,7 @@ impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
2092
2104
2093
2105
blocked_monitor_updates: Vec::new(),
2094
2106
local_initiated_shutdown: None,
2107
+ manually_broadcast_outbound_channels: if config.manually_broadcast_outbound_channels { Some(()) } else { None }
2095
2108
})
2096
2109
}
2097
2110
@@ -2333,6 +2346,10 @@ impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
2333
2346
self.config.options.forwarding_fee_proportional_millionths
2334
2347
}
2335
2348
2349
+ pub fn get_manually_broadcast_outbound_channels(&self) -> Option<()> {
2350
+ self.manually_broadcast_outbound_channels
2351
+ }
2352
+
2336
2353
pub fn get_cltv_expiry_delta(&self) -> u16 {
2337
2354
cmp::max(self.config.options.cltv_expiry_delta, MIN_CLTV_EXPIRY_DELTA)
2338
2355
}
@@ -9047,6 +9064,7 @@ impl<'a, 'b, 'c, ES: Deref, SP: Deref> ReadableArgs<(&'a ES, &'b SP, u32, &'c Ch
9047
9064
let mut holding_cell_skimmed_fees_opt: Option<Vec<Option<u64>>> = None;
9048
9065
9049
9066
let mut is_batch_funding: Option<()> = None;
9067
+ let mut manually_broadcast_outbound_channels: Option<()> = None;
9050
9068
9051
9069
let mut local_initiated_shutdown: Option<()> = None;
9052
9070
@@ -9088,6 +9106,7 @@ impl<'a, 'b, 'c, ES: Deref, SP: Deref> ReadableArgs<(&'a ES, &'b SP, u32, &'c Ch
9088
9106
(43, malformed_htlcs, optional_vec), // Added in 0.0.119
9089
9107
// 45 and 47 are reserved for async signing
9090
9108
(49, local_initiated_shutdown, option),
9109
+ (51, manually_broadcast_outbound_channels, option),
9091
9110
});
9092
9111
9093
9112
let (channel_keys_id, holder_signer) = if let Some(channel_keys_id) = channel_keys_id {
@@ -9322,6 +9341,7 @@ impl<'a, 'b, 'c, ES: Deref, SP: Deref> ReadableArgs<(&'a ES, &'b SP, u32, &'c Ch
9322
9341
local_initiated_shutdown,
9323
9342
9324
9343
blocked_monitor_updates: blocked_monitor_updates.unwrap(),
9344
+ manually_broadcast_outbound_channels,
9325
9345
},
9326
9346
#[cfg(any(dual_funding, splicing))]
9327
9347
dual_funding_channel_context: None,
0 commit comments