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