@@ -426,6 +426,9 @@ pub struct CommitmentSigned {
426426 pub signature : Signature ,
427427 /// Signatures on the HTLC transactions
428428 pub htlc_signatures : Vec < Signature > ,
429+ #[ cfg( taproot) ]
430+ /// The partial Taproot signature on the commitment transaction
431+ pub partial_signature_with_nonce : Option < PartialSignatureWithNonce > ,
429432}
430433
431434/// A [`revoke_and_ack`] message to be sent to or received from a peer.
@@ -1402,12 +1405,22 @@ impl_writeable!(ClosingSignedFeeRange, {
14021405 max_fee_satoshis
14031406} ) ;
14041407
1408+ #[ cfg( not( taproot) ) ]
14051409impl_writeable_msg ! ( CommitmentSigned , {
14061410 channel_id,
14071411 signature,
14081412 htlc_signatures
14091413} , { } ) ;
14101414
1415+ #[ cfg( taproot) ]
1416+ impl_writeable_msg ! ( CommitmentSigned , {
1417+ channel_id,
1418+ signature,
1419+ htlc_signatures
1420+ } , {
1421+ ( 2 , partial_signature_with_nonce, option)
1422+ } ) ;
1423+
14111424impl_writeable ! ( DecodedOnionErrorPacket , {
14121425 hmac,
14131426 failuremsg,
@@ -2713,6 +2726,8 @@ mod tests {
27132726 channel_id : [ 2 ; 32 ] ,
27142727 signature : sig_1,
27152728 htlc_signatures : if htlcs { vec ! [ sig_2, sig_3, sig_4] } else { Vec :: new ( ) } ,
2729+ #[ cfg( taproot) ]
2730+ partial_signature_with_nonce : None ,
27162731 } ;
27172732 let encoded_value = commitment_signed. encode ( ) ;
27182733 let mut target_value = hex:: decode ( "0202020202020202020202020202020202020202020202020202020202020202d977cb9b53d93a6ff64bb5f1e158b4094b66e798fb12911168a3ccdf80a83096340a6a95da0ae8d9f776528eecdbb747eb6b545495a4319ed5378e35b21e073a" ) . unwrap ( ) ;
0 commit comments