@@ -97,25 +97,31 @@ pub(crate) struct RevokedOutput {
9797 weight : u64 ,
9898 amount : u64 ,
9999 on_counterparty_tx_csv : u16 ,
100+ opt_anchors : Option < ( ) > ,
101+ is_counterparty_balance : Option < ( ) > ,
100102}
101103
102104impl RevokedOutput {
103- pub ( crate ) fn build ( per_commitment_point : PublicKey , counterparty_delayed_payment_base_key : PublicKey , counterparty_htlc_base_key : PublicKey , per_commitment_key : SecretKey , amount : u64 , on_counterparty_tx_csv : u16 ) -> Self {
105+ pub ( crate ) fn build ( per_commitment_point : PublicKey , counterparty_delayed_payment_base_key : PublicKey , counterparty_htlc_base_key : PublicKey , per_commitment_key : SecretKey , amount : u64 , on_counterparty_tx_csv : u16 , opt_anchors : bool , is_counterparty_balance : bool ) -> Self {
104106 RevokedOutput {
105107 per_commitment_point,
106108 counterparty_delayed_payment_base_key,
107109 counterparty_htlc_base_key,
108110 per_commitment_key,
109111 weight : WEIGHT_REVOKED_OUTPUT ,
110112 amount,
111- on_counterparty_tx_csv
113+ on_counterparty_tx_csv,
114+ opt_anchors : if opt_anchors { Some ( ( ) ) } else { None } ,
115+ is_counterparty_balance : if is_counterparty_balance { Some ( ( ) ) } else { None } ,
112116 }
113117 }
114118}
115119
116120impl_writeable_tlv_based ! ( RevokedOutput , {
117121 ( 0 , per_commitment_point, required) ,
122+ ( 1 , opt_anchors, option) ,
118123 ( 2 , counterparty_delayed_payment_base_key, required) ,
124+ ( 3 , is_counterparty_balance, option) ,
119125 ( 4 , counterparty_htlc_base_key, required) ,
120126 ( 6 , per_commitment_key, required) ,
121127 ( 8 , weight, required) ,
@@ -800,7 +806,9 @@ impl Readable for PackageTemplate {
800806 }
801807 let ( malleability, aggregable) = if let Some ( ( _, lead_input) ) = inputs. first ( ) {
802808 match lead_input {
803- PackageSolvingData :: RevokedOutput ( ..) => { ( PackageMalleability :: Malleable , true ) } ,
809+ PackageSolvingData :: RevokedOutput ( RevokedOutput { is_counterparty_balance : None , .. } ) => { ( PackageMalleability :: Malleable , true ) } ,
810+ PackageSolvingData :: RevokedOutput ( RevokedOutput { opt_anchors : Some ( ..) , .. } ) => { ( PackageMalleability :: Malleable , false ) } ,
811+ PackageSolvingData :: RevokedOutput ( RevokedOutput { opt_anchors : None , .. } ) => { ( PackageMalleability :: Malleable , true ) } ,
804812 PackageSolvingData :: RevokedHTLCOutput ( ..) => { ( PackageMalleability :: Malleable , true ) } ,
805813 PackageSolvingData :: CounterpartyOfferedHTLCOutput ( ..) => { ( PackageMalleability :: Malleable , true ) } ,
806814 PackageSolvingData :: CounterpartyReceivedHTLCOutput ( ..) => { ( PackageMalleability :: Malleable , false ) } ,
0 commit comments