@@ -628,6 +628,14 @@ pub(super) struct Channel<Signer: ChannelSigner> {
628
628
/// `accept_inbound_channel`, and `funding_created` should therefore not execute successfully.
629
629
inbound_awaiting_accept : bool ,
630
630
631
+ /// A flag that indicates whether the channel requires the user to signal readiness to send
632
+ /// the `msgs::ChannelReady` message. This is only set to true if the channel was created with a
633
+ /// `ChannelHandshakeConfig::manually_signal_channel_ready` flag set to true.
634
+ ///
635
+ /// When a user signals readiness via `ChannelManager::signal_channel_readiness` this flag is
636
+ /// flipped to false.
637
+ requires_manual_readiness_signal : bool ,
638
+
631
639
/// The hash of the block in which the funding transaction was included.
632
640
funding_tx_confirmed_in : Option < BlockHash > ,
633
641
funding_tx_confirmation_height : u32 ,
@@ -1065,6 +1073,7 @@ impl<Signer: WriteableEcdsaChannelSigner> Channel<Signer> {
1065
1073
target_closing_feerate_sats_per_kw : None ,
1066
1074
1067
1075
inbound_awaiting_accept : false ,
1076
+ requires_manual_readiness_signal : config. channel_handshake_config . manually_signal_channel_ready ,
1068
1077
1069
1078
funding_tx_confirmed_in : None ,
1070
1079
funding_tx_confirmation_height : 0 ,
@@ -1409,6 +1418,7 @@ impl<Signer: WriteableEcdsaChannelSigner> Channel<Signer> {
1409
1418
target_closing_feerate_sats_per_kw : None ,
1410
1419
1411
1420
inbound_awaiting_accept : true ,
1421
+ requires_manual_readiness_signal : config. channel_handshake_config . manually_signal_channel_ready ,
1412
1422
1413
1423
funding_tx_confirmed_in : None ,
1414
1424
funding_tx_confirmation_height : 0 ,
@@ -5305,6 +5315,10 @@ impl<Signer: WriteableEcdsaChannelSigner> Channel<Signer> {
5305
5315
self . inbound_awaiting_accept
5306
5316
}
5307
5317
5318
+ pub fn requires_manual_readiness_signal ( & self ) -> bool {
5319
+ self . requires_manual_readiness_signal
5320
+ }
5321
+
5308
5322
/// Sets this channel to accepting 0conf, must be done before `get_accept_channel`
5309
5323
pub fn set_0conf ( & mut self ) {
5310
5324
assert ! ( self . inbound_awaiting_accept) ;
@@ -6459,6 +6473,8 @@ impl<Signer: WriteableEcdsaChannelSigner> Writeable for Channel<Signer> {
6459
6473
// we write the high bytes as an option here.
6460
6474
let user_id_high_opt = Some ( ( self . user_id >> 64 ) as u64 ) ;
6461
6475
6476
+ let requires_manual_readiness_signal = Some ( self . requires_manual_readiness_signal ) ;
6477
+
6462
6478
write_tlv_fields ! ( writer, {
6463
6479
( 0 , self . announcement_sigs, option) ,
6464
6480
// minimum_depth and counterparty_selected_channel_reserve_satoshis used to have a
@@ -6484,6 +6500,7 @@ impl<Signer: WriteableEcdsaChannelSigner> Writeable for Channel<Signer> {
6484
6500
( 23 , channel_ready_event_emitted, option) ,
6485
6501
( 25 , user_id_high_opt, option) ,
6486
6502
( 27 , self . channel_keys_id, required) ,
6503
+ ( 29 , requires_manual_readiness_signal, option)
6487
6504
} ) ;
6488
6505
6489
6506
Ok ( ( ) )
@@ -6755,6 +6772,7 @@ impl<'a, 'b, 'c, ES: Deref, SP: Deref> ReadableArgs<(&'a ES, &'b SP, u32, &'c Ch
6755
6772
6756
6773
let mut user_id_high_opt: Option < u64 > = None ;
6757
6774
let mut channel_keys_id: Option < [ u8 ; 32 ] > = None ;
6775
+ let mut requires_manual_readiness_signal: Option < bool > = Some ( false ) ;
6758
6776
6759
6777
read_tlv_fields ! ( reader, {
6760
6778
( 0 , announcement_sigs, option) ,
@@ -6775,6 +6793,7 @@ impl<'a, 'b, 'c, ES: Deref, SP: Deref> ReadableArgs<(&'a ES, &'b SP, u32, &'c Ch
6775
6793
( 23 , channel_ready_event_emitted, option) ,
6776
6794
( 25 , user_id_high_opt, option) ,
6777
6795
( 27 , channel_keys_id, option) ,
6796
+ ( 29 , requires_manual_readiness_signal, option) ,
6778
6797
} ) ;
6779
6798
6780
6799
let ( channel_keys_id, holder_signer) = if let Some ( channel_keys_id) = channel_keys_id {
@@ -6885,6 +6904,7 @@ impl<'a, 'b, 'c, ES: Deref, SP: Deref> ReadableArgs<(&'a ES, &'b SP, u32, &'c Ch
6885
6904
target_closing_feerate_sats_per_kw,
6886
6905
6887
6906
inbound_awaiting_accept : false ,
6907
+ requires_manual_readiness_signal : requires_manual_readiness_signal. unwrap ( ) ,
6888
6908
6889
6909
funding_tx_confirmed_in,
6890
6910
funding_tx_confirmation_height,
0 commit comments