@@ -6121,19 +6121,13 @@ where
6121
6121
}
6122
6122
}
6123
6123
6124
- fn get_initial_counterparty_commitment_signature <L: Deref>(
6124
+ fn get_initial_counterparty_commitment_signatures <L: Deref>(
6125
6125
&self, funding: &FundingScope, logger: &L,
6126
- ) -> Option<Signature>
6126
+ ) -> Option<( Signature, Vec<Signature>) >
6127
6127
where
6128
6128
SP::Target: SignerProvider,
6129
6129
L::Target: Logger,
6130
6130
{
6131
- let is_quiescent = matches!(
6132
- self.channel_state,
6133
- ChannelState::ChannelReady(f) if f.is_set(ChannelReadyFlags::QUIESCENT)
6134
- );
6135
- debug_assert!(self.channel_state.is_interactive_signing() || is_quiescent);
6136
-
6137
6131
let mut commitment_number = self.counterparty_next_commitment_transaction_number;
6138
6132
let mut commitment_point = self.counterparty_next_commitment_point.unwrap();
6139
6133
@@ -6164,7 +6158,6 @@ where
6164
6158
Vec::new(),
6165
6159
&self.secp_ctx,
6166
6160
)
6167
- .map(|(signature, _)| signature)
6168
6161
.ok()
6169
6162
},
6170
6163
// TODO (taproot|arik)
@@ -6180,16 +6173,26 @@ where
6180
6173
SP::Target: SignerProvider,
6181
6174
L::Target: Logger,
6182
6175
{
6183
- let signature = self.get_initial_counterparty_commitment_signature(funding, logger);
6184
- if let Some(signature) = signature {
6176
+ let is_quiescent = matches!(
6177
+ self.channel_state,
6178
+ ChannelState::ChannelReady(f) if f.is_set(ChannelReadyFlags::QUIESCENT)
6179
+ );
6180
+ debug_assert!(self.channel_state.is_interactive_signing() || is_quiescent);
6181
+
6182
+ let signatures = self.get_initial_counterparty_commitment_signatures(funding, logger);
6183
+ if let Some((signature, htlc_signatures)) = signatures {
6185
6184
log_info!(
6186
6185
logger,
6187
6186
"Generated commitment_signed for peer for channel {}",
6188
6187
&self.channel_id()
6189
6188
);
6189
+ debug_assert_eq!(
6190
+ htlc_signatures.is_empty(),
6191
+ self.channel_state.is_interactive_signing()
6192
+ );
6190
6193
Some(msgs::CommitmentSigned {
6191
6194
channel_id: self.channel_id,
6192
- htlc_signatures: vec![] ,
6195
+ htlc_signatures,
6193
6196
signature,
6194
6197
funding_txid: funding.get_funding_txo().map(|funding_txo| funding_txo.txid),
6195
6198
#[cfg(taproot)]
@@ -6213,7 +6216,7 @@ where
6213
6216
self.channel_state = ChannelState::FundingNegotiated(FundingNegotiatedFlags::new());
6214
6217
self.channel_state.set_interactive_signing();
6215
6218
self.counterparty_next_commitment_point = Some(counterparty_next_commitment_point_override);
6216
- self.get_initial_counterparty_commitment_signature (funding, logger)
6219
+ self.get_initial_counterparty_commitment_signatures (funding, logger).map(|(sig, _)| sig )
6217
6220
}
6218
6221
6219
6222
fn check_funding_meets_minimum_depth(&self, funding: &FundingScope, height: u32) -> bool {
0 commit comments