@@ -97,25 +97,31 @@ pub(crate) struct RevokedOutput {
97
97
weight : u64 ,
98
98
amount : u64 ,
99
99
on_counterparty_tx_csv : u16 ,
100
+ opt_anchors : Option < ( ) > ,
101
+ is_counterparty_balance : Option < ( ) > ,
100
102
}
101
103
102
104
impl 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 {
104
106
RevokedOutput {
105
107
per_commitment_point,
106
108
counterparty_delayed_payment_base_key,
107
109
counterparty_htlc_base_key,
108
110
per_commitment_key,
109
111
weight : WEIGHT_REVOKED_OUTPUT ,
110
112
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 } ,
112
116
}
113
117
}
114
118
}
115
119
116
120
impl_writeable_tlv_based ! ( RevokedOutput , {
117
121
( 0 , per_commitment_point, required) ,
122
+ ( 1 , opt_anchors, option) ,
118
123
( 2 , counterparty_delayed_payment_base_key, required) ,
124
+ ( 3 , is_counterparty_balance, option) ,
119
125
( 4 , counterparty_htlc_base_key, required) ,
120
126
( 6 , per_commitment_key, required) ,
121
127
( 8 , weight, required) ,
@@ -800,7 +806,9 @@ impl Readable for PackageTemplate {
800
806
}
801
807
let ( malleability, aggregable) = if let Some ( ( _, lead_input) ) = inputs. first ( ) {
802
808
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 ) } ,
804
812
PackageSolvingData :: RevokedHTLCOutput ( ..) => { ( PackageMalleability :: Malleable , true ) } ,
805
813
PackageSolvingData :: CounterpartyOfferedHTLCOutput ( ..) => { ( PackageMalleability :: Malleable , true ) } ,
806
814
PackageSolvingData :: CounterpartyReceivedHTLCOutput ( ..) => { ( PackageMalleability :: Malleable , false ) } ,
@@ -930,7 +938,7 @@ mod tests {
930
938
{
931
939
let dumb_scalar = SecretKey :: from_slice( & hex:: decode( "0101010101010101010101010101010101010101010101010101010101010101" ) . unwrap( ) [ ..] ) . unwrap( ) ;
932
940
let dumb_point = PublicKey :: from_secret_key( & $secp_ctx, & dumb_scalar) ;
933
- PackageSolvingData :: RevokedOutput ( RevokedOutput :: build( dumb_point, dumb_point, dumb_point, dumb_scalar, 0 , 0 ) )
941
+ PackageSolvingData :: RevokedOutput ( RevokedOutput :: build( dumb_point, dumb_point, dumb_point, dumb_scalar, 0 , 0 , false , false ) )
934
942
}
935
943
}
936
944
}
0 commit comments