@@ -5748,6 +5748,7 @@ impl<Signer: WriteableEcdsaChannelSigner> OutboundV1Channel<Signer> {
5748
5748
} else {
5749
5749
self . context . channel_type = ChannelTypeFeatures :: only_static_remote_key ( ) ;
5750
5750
}
5751
+ self . context . channel_transaction_parameters . channel_type_features = self . context . channel_type . clone ( ) ;
5751
5752
Ok ( self . get_open_channel ( chain_hash) )
5752
5753
}
5753
5754
@@ -5866,7 +5867,8 @@ impl<Signer: WriteableEcdsaChannelSigner> OutboundV1Channel<Signer> {
5866
5867
if channel_type != ChannelTypeFeatures :: only_static_remote_key ( ) {
5867
5868
return Err ( ChannelError :: Close ( "Only static_remote_key is supported for non-negotiated channel types" . to_owned ( ) ) ) ;
5868
5869
}
5869
- self . context . channel_type = channel_type;
5870
+ self . context . channel_type = channel_type. clone ( ) ;
5871
+ self . context . channel_transaction_parameters . channel_type_features = channel_type;
5870
5872
}
5871
5873
5872
5874
let counterparty_shutdown_scriptpubkey = if their_features. supports_upfront_shutdown_script ( ) {
@@ -7039,7 +7041,7 @@ impl<'a, 'b, 'c, ES: Deref, SP: Deref> ReadableArgs<(&'a ES, &'b SP, u32, &'c Ch
7039
7041
_ => return Err ( DecodeError :: InvalidValue ) ,
7040
7042
} ;
7041
7043
7042
- let channel_parameters: ChannelTransactionParameters = Readable :: read ( reader) ?;
7044
+ let mut channel_parameters: ChannelTransactionParameters = Readable :: read ( reader) ?;
7043
7045
let funding_transaction = Readable :: read ( reader) ?;
7044
7046
7045
7047
let counterparty_cur_commitment_point = Readable :: read ( reader) ?;
@@ -7165,6 +7167,10 @@ impl<'a, 'b, 'c, ES: Deref, SP: Deref> ReadableArgs<(&'a ES, &'b SP, u32, &'c Ch
7165
7167
return Err ( DecodeError :: UnknownRequiredFeature ) ;
7166
7168
}
7167
7169
7170
+ // ChannelTransactionParameters may have had an empty features set upon deserialization.
7171
+ // To account for that, we're proactively setting/overriding the field here.
7172
+ channel_parameters. channel_type_features = chan_features. clone ( ) ;
7173
+
7168
7174
let mut secp_ctx = Secp256k1 :: new ( ) ;
7169
7175
secp_ctx. seeded_randomize ( & entropy_source. get_secure_random_bytes ( ) ) ;
7170
7176
0 commit comments