@@ -43,7 +43,7 @@ pub enum SpendableOutputDescriptor {
43
43
/// using chan_utils::derive_public_key and only the delayed_payment_basepoint which appears in
44
44
/// ChannelKeys::pubkeys().
45
45
///
46
- /// To derive the counterparty_revocation_pubkey provided here (which is used in the witness
46
+ /// To derive the revocation_pubkey provided here (which is used in the witness
47
47
/// script generation), you must pass the remote revocation_basepoint (which appears in the
48
48
/// call to ChannelKeys::on_accept) and the provided per_commitment point
49
49
/// to chan_utils::derive_public_revocation_key.
@@ -58,7 +58,7 @@ pub enum SpendableOutputDescriptor {
58
58
to_self_delay : u16 ,
59
59
output : crate :: c_types:: TxOut ,
60
60
key_derivation_params : crate :: c_types:: derived:: C2Tuple_u64u64Z ,
61
- counterparty_revocation_pubkey : crate :: c_types:: PublicKey ,
61
+ revocation_pubkey : crate :: c_types:: PublicKey ,
62
62
} ,
63
63
/// An output to a P2WPKH, spendable exclusively by our payment key (ie the private key which
64
64
/// corresponds to the public key in ChannelKeys::pubkeys().payment_point).
@@ -86,21 +86,21 @@ impl SpendableOutputDescriptor {
86
86
output : output_nonref. into_rust ( ) ,
87
87
}
88
88
} ,
89
- SpendableOutputDescriptor :: DynamicOutputP2WSH { ref outpoint, ref per_commitment_point, ref to_self_delay, ref output, ref key_derivation_params, ref counterparty_revocation_pubkey , } => {
89
+ SpendableOutputDescriptor :: DynamicOutputP2WSH { ref outpoint, ref per_commitment_point, ref to_self_delay, ref output, ref key_derivation_params, ref revocation_pubkey , } => {
90
90
let mut outpoint_nonref = ( * outpoint) . clone ( ) ;
91
91
let mut per_commitment_point_nonref = ( * per_commitment_point) . clone ( ) ;
92
92
let mut to_self_delay_nonref = ( * to_self_delay) . clone ( ) ;
93
93
let mut output_nonref = ( * output) . clone ( ) ;
94
94
let mut key_derivation_params_nonref = ( * key_derivation_params) . clone ( ) ;
95
95
let ( mut orig_key_derivation_params_nonref_0, mut orig_key_derivation_params_nonref_1) = key_derivation_params_nonref. to_rust ( ) ; let mut local_key_derivation_params_nonref = ( orig_key_derivation_params_nonref_0, orig_key_derivation_params_nonref_1) ;
96
- let mut counterparty_revocation_pubkey_nonref = ( * counterparty_revocation_pubkey ) . clone ( ) ;
96
+ let mut revocation_pubkey_nonref = ( * revocation_pubkey ) . clone ( ) ;
97
97
nativeSpendableOutputDescriptor:: DynamicOutputP2WSH {
98
98
outpoint : * unsafe { Box :: from_raw ( outpoint_nonref. take_ptr ( ) ) } ,
99
99
per_commitment_point : per_commitment_point_nonref. into_rust ( ) ,
100
100
to_self_delay : to_self_delay_nonref,
101
101
output : output_nonref. into_rust ( ) ,
102
102
key_derivation_params : local_key_derivation_params_nonref,
103
- counterparty_revocation_pubkey : counterparty_revocation_pubkey_nonref . into_rust ( ) ,
103
+ revocation_pubkey : revocation_pubkey_nonref . into_rust ( ) ,
104
104
}
105
105
} ,
106
106
SpendableOutputDescriptor :: StaticOutputCounterpartyPayment { ref outpoint, ref output, ref key_derivation_params, } => {
@@ -125,15 +125,15 @@ impl SpendableOutputDescriptor {
125
125
output : output. into_rust ( ) ,
126
126
}
127
127
} ,
128
- SpendableOutputDescriptor :: DynamicOutputP2WSH { mut outpoint, mut per_commitment_point, mut to_self_delay, mut output, mut key_derivation_params, mut counterparty_revocation_pubkey , } => {
128
+ SpendableOutputDescriptor :: DynamicOutputP2WSH { mut outpoint, mut per_commitment_point, mut to_self_delay, mut output, mut key_derivation_params, mut revocation_pubkey , } => {
129
129
let ( mut orig_key_derivation_params_0, mut orig_key_derivation_params_1) = key_derivation_params. to_rust ( ) ; let mut local_key_derivation_params = ( orig_key_derivation_params_0, orig_key_derivation_params_1) ;
130
130
nativeSpendableOutputDescriptor:: DynamicOutputP2WSH {
131
131
outpoint : * unsafe { Box :: from_raw ( outpoint. take_ptr ( ) ) } ,
132
132
per_commitment_point : per_commitment_point. into_rust ( ) ,
133
133
to_self_delay : to_self_delay,
134
134
output : output. into_rust ( ) ,
135
135
key_derivation_params : local_key_derivation_params,
136
- counterparty_revocation_pubkey : counterparty_revocation_pubkey . into_rust ( ) ,
136
+ revocation_pubkey : revocation_pubkey . into_rust ( ) ,
137
137
}
138
138
} ,
139
139
SpendableOutputDescriptor :: StaticOutputCounterpartyPayment { mut outpoint, mut output, mut key_derivation_params, } => {
@@ -157,21 +157,21 @@ impl SpendableOutputDescriptor {
157
157
output : crate :: c_types:: TxOut :: from_rust ( output_nonref) ,
158
158
}
159
159
} ,
160
- nativeSpendableOutputDescriptor:: DynamicOutputP2WSH { ref outpoint, ref per_commitment_point, ref to_self_delay, ref output, ref key_derivation_params, ref counterparty_revocation_pubkey , } => {
160
+ nativeSpendableOutputDescriptor:: DynamicOutputP2WSH { ref outpoint, ref per_commitment_point, ref to_self_delay, ref output, ref key_derivation_params, ref revocation_pubkey , } => {
161
161
let mut outpoint_nonref = ( * outpoint) . clone ( ) ;
162
162
let mut per_commitment_point_nonref = ( * per_commitment_point) . clone ( ) ;
163
163
let mut to_self_delay_nonref = ( * to_self_delay) . clone ( ) ;
164
164
let mut output_nonref = ( * output) . clone ( ) ;
165
165
let mut key_derivation_params_nonref = ( * key_derivation_params) . clone ( ) ;
166
166
let ( mut orig_key_derivation_params_nonref_0, mut orig_key_derivation_params_nonref_1) = key_derivation_params_nonref; let mut local_key_derivation_params_nonref = ( orig_key_derivation_params_nonref_0, orig_key_derivation_params_nonref_1) . into ( ) ;
167
- let mut counterparty_revocation_pubkey_nonref = ( * counterparty_revocation_pubkey ) . clone ( ) ;
167
+ let mut revocation_pubkey_nonref = ( * revocation_pubkey ) . clone ( ) ;
168
168
SpendableOutputDescriptor :: DynamicOutputP2WSH {
169
169
outpoint : crate :: chain:: transaction:: OutPoint { inner : Box :: into_raw ( Box :: new ( outpoint_nonref) ) , is_owned : true } ,
170
170
per_commitment_point : crate :: c_types:: PublicKey :: from_rust ( & per_commitment_point_nonref) ,
171
171
to_self_delay : to_self_delay_nonref,
172
172
output : crate :: c_types:: TxOut :: from_rust ( output_nonref) ,
173
173
key_derivation_params : local_key_derivation_params_nonref,
174
- counterparty_revocation_pubkey : crate :: c_types:: PublicKey :: from_rust ( & counterparty_revocation_pubkey_nonref ) ,
174
+ revocation_pubkey : crate :: c_types:: PublicKey :: from_rust ( & revocation_pubkey_nonref ) ,
175
175
}
176
176
} ,
177
177
nativeSpendableOutputDescriptor:: StaticOutputCounterpartyPayment { ref outpoint, ref output, ref key_derivation_params, } => {
@@ -196,15 +196,15 @@ impl SpendableOutputDescriptor {
196
196
output : crate :: c_types:: TxOut :: from_rust ( output) ,
197
197
}
198
198
} ,
199
- nativeSpendableOutputDescriptor:: DynamicOutputP2WSH { mut outpoint, mut per_commitment_point, mut to_self_delay, mut output, mut key_derivation_params, mut counterparty_revocation_pubkey , } => {
199
+ nativeSpendableOutputDescriptor:: DynamicOutputP2WSH { mut outpoint, mut per_commitment_point, mut to_self_delay, mut output, mut key_derivation_params, mut revocation_pubkey , } => {
200
200
let ( mut orig_key_derivation_params_0, mut orig_key_derivation_params_1) = key_derivation_params; let mut local_key_derivation_params = ( orig_key_derivation_params_0, orig_key_derivation_params_1) . into ( ) ;
201
201
SpendableOutputDescriptor :: DynamicOutputP2WSH {
202
202
outpoint : crate :: chain:: transaction:: OutPoint { inner : Box :: into_raw ( Box :: new ( outpoint) ) , is_owned : true } ,
203
203
per_commitment_point : crate :: c_types:: PublicKey :: from_rust ( & per_commitment_point) ,
204
204
to_self_delay : to_self_delay,
205
205
output : crate :: c_types:: TxOut :: from_rust ( output) ,
206
206
key_derivation_params : local_key_derivation_params,
207
- counterparty_revocation_pubkey : crate :: c_types:: PublicKey :: from_rust ( & counterparty_revocation_pubkey ) ,
207
+ revocation_pubkey : crate :: c_types:: PublicKey :: from_rust ( & revocation_pubkey ) ,
208
208
}
209
209
} ,
210
210
nativeSpendableOutputDescriptor:: StaticOutputCounterpartyPayment { mut outpoint, mut output, mut key_derivation_params, } => {
@@ -282,7 +282,7 @@ pub struct ChannelKeys {
282
282
/// that it will not be called multiple times.
283
283
/// An external signer implementation should check that the commitment has not been revoked.
284
284
#[ must_use]
285
- pub sign_holder_commitment : extern "C" fn ( this_arg : * const c_void , holder_commitment_tx : & crate :: ln:: chan_utils:: LocalCommitmentTransaction ) -> crate :: c_types:: derived:: CResult_SignatureNoneZ ,
285
+ pub sign_holder_commitment : extern "C" fn ( this_arg : * const c_void , holder_commitment_tx : & crate :: ln:: chan_utils:: HolderCommitmentTransaction ) -> crate :: c_types:: derived:: CResult_SignatureNoneZ ,
286
286
/// Create a signature for each HTLC transaction spending a holder commitment transaction.
287
287
///
288
288
/// Unlike sign_holder_commitment, this may be called multiple times with *different*
@@ -297,7 +297,7 @@ pub struct ChannelKeys {
297
297
/// a corresponding None should be included in the return value. All other positions in the
298
298
/// return value must contain a signature.
299
299
#[ must_use]
300
- pub sign_holder_commitment_htlc_transactions : extern "C" fn ( this_arg : * const c_void , holder_commitment_tx : & crate :: ln:: chan_utils:: LocalCommitmentTransaction ) -> crate :: c_types:: derived:: CResult_CVec_SignatureZNoneZ ,
300
+ pub sign_holder_commitment_htlc_transactions : extern "C" fn ( this_arg : * const c_void , holder_commitment_tx : & crate :: ln:: chan_utils:: HolderCommitmentTransaction ) -> crate :: c_types:: derived:: CResult_CVec_SignatureZNoneZ ,
301
301
/// Create a signature for the given input in a transaction spending an HTLC or commitment
302
302
/// transaction output when our counterparty broadcasts an old state.
303
303
///
@@ -413,13 +413,13 @@ impl rustChannelKeys for ChannelKeys {
413
413
let mut local_ret = match ret. result_ok { true => Ok ( { let ( mut orig_ret_0_0, mut orig_ret_0_1) = ( * unsafe { Box :: from_raw ( ret. contents . result . take_ptr ( ) ) } ) . to_rust ( ) ; let mut local_orig_ret_0_1 = Vec :: new ( ) ; for mut item in orig_ret_0_1. into_rust ( ) . drain ( ..) { local_orig_ret_0_1. push ( { item. into_rust ( ) } ) ; } ; let mut local_ret_0 = ( orig_ret_0_0. into_rust ( ) , local_orig_ret_0_1) ; local_ret_0 } ) , false => Err ( { ( ) /*(*unsafe { Box::from_raw(ret.contents.err.take_ptr()) })*/ } ) } ;
414
414
local_ret
415
415
}
416
- fn sign_holder_commitment < T : bitcoin:: secp256k1:: Signing + bitcoin:: secp256k1:: Verification > ( & self , local_commitment_tx : & lightning:: ln:: chan_utils:: LocalCommitmentTransaction , _secp_ctx : & bitcoin:: secp256k1:: Secp256k1 < T > ) -> Result < bitcoin:: secp256k1:: Signature , ( ) > {
417
- let mut ret = ( self . sign_holder_commitment ) ( self . this_arg , & crate :: ln:: chan_utils:: LocalCommitmentTransaction { inner : unsafe { ( local_commitment_tx as * const _ ) as * mut _ } , is_owned : false } ) ;
416
+ fn sign_holder_commitment < T : bitcoin:: secp256k1:: Signing + bitcoin:: secp256k1:: Verification > ( & self , local_commitment_tx : & lightning:: ln:: chan_utils:: HolderCommitmentTransaction , _secp_ctx : & bitcoin:: secp256k1:: Secp256k1 < T > ) -> Result < bitcoin:: secp256k1:: Signature , ( ) > {
417
+ let mut ret = ( self . sign_holder_commitment ) ( self . this_arg , & crate :: ln:: chan_utils:: HolderCommitmentTransaction { inner : unsafe { ( local_commitment_tx as * const _ ) as * mut _ } , is_owned : false } ) ;
418
418
let mut local_ret = match ret. result_ok { true => Ok ( { ( * unsafe { Box :: from_raw ( ret. contents . result . take_ptr ( ) ) } ) . into_rust ( ) } ) , false => Err ( { ( ) /*(*unsafe { Box::from_raw(ret.contents.err.take_ptr()) })*/ } ) } ;
419
419
local_ret
420
420
}
421
- fn sign_holder_commitment_htlc_transactions < T : bitcoin:: secp256k1:: Signing + bitcoin:: secp256k1:: Verification > ( & self , local_commitment_tx : & lightning:: ln:: chan_utils:: LocalCommitmentTransaction , _secp_ctx : & bitcoin:: secp256k1:: Secp256k1 < T > ) -> Result < Vec < Option < bitcoin:: secp256k1:: Signature > > , ( ) > {
422
- let mut ret = ( self . sign_holder_commitment_htlc_transactions ) ( self . this_arg , & crate :: ln:: chan_utils:: LocalCommitmentTransaction { inner : unsafe { ( local_commitment_tx as * const _ ) as * mut _ } , is_owned : false } ) ;
421
+ fn sign_holder_commitment_htlc_transactions < T : bitcoin:: secp256k1:: Signing + bitcoin:: secp256k1:: Verification > ( & self , local_commitment_tx : & lightning:: ln:: chan_utils:: HolderCommitmentTransaction , _secp_ctx : & bitcoin:: secp256k1:: Secp256k1 < T > ) -> Result < Vec < Option < bitcoin:: secp256k1:: Signature > > , ( ) > {
422
+ let mut ret = ( self . sign_holder_commitment_htlc_transactions ) ( self . this_arg , & crate :: ln:: chan_utils:: HolderCommitmentTransaction { inner : unsafe { ( local_commitment_tx as * const _ ) as * mut _ } , is_owned : false } ) ;
423
423
let mut local_ret = match ret. result_ok { true => Ok ( { let mut local_ret_0 = Vec :: new ( ) ; for mut item in ( * unsafe { Box :: from_raw ( ret. contents . result . take_ptr ( ) ) } ) . into_rust ( ) . drain ( ..) { local_ret_0. push ( { let mut local_ret_0_0 = if item. is_null ( ) { None } else { Some ( { item. into_rust ( ) } ) } ; local_ret_0_0 } ) ; } ; local_ret_0 } ) , false => Err ( { ( ) /*(*unsafe { Box::from_raw(ret.contents.err.take_ptr()) })*/ } ) } ;
424
424
local_ret
425
425
}
@@ -757,13 +757,13 @@ extern "C" fn InMemoryChannelKeys_ChannelKeys_sign_counterparty_commitment(this_
757
757
local_ret
758
758
}
759
759
#[ must_use]
760
- extern "C" fn InMemoryChannelKeys_ChannelKeys_sign_holder_commitment ( this_arg : * const c_void , local_commitment_tx : & crate :: ln:: chan_utils:: LocalCommitmentTransaction ) -> crate :: c_types:: derived:: CResult_SignatureNoneZ {
760
+ extern "C" fn InMemoryChannelKeys_ChannelKeys_sign_holder_commitment ( this_arg : * const c_void , local_commitment_tx : & crate :: ln:: chan_utils:: HolderCommitmentTransaction ) -> crate :: c_types:: derived:: CResult_SignatureNoneZ {
761
761
let mut ret = unsafe { & mut * ( this_arg as * mut nativeInMemoryChannelKeys ) } . sign_holder_commitment ( unsafe { & * local_commitment_tx. inner } , & bitcoin:: secp256k1:: Secp256k1 :: new ( ) ) ;
762
762
let mut local_ret = match ret { Ok ( mut o) => crate :: c_types:: CResultTempl :: ok ( { crate :: c_types:: Signature :: from_rust ( & o) } ) , Err ( mut e) => crate :: c_types:: CResultTempl :: err ( { 0u8 /*e*/ } ) } ;
763
763
local_ret
764
764
}
765
765
#[ must_use]
766
- extern "C" fn InMemoryChannelKeys_ChannelKeys_sign_holder_commitment_htlc_transactions ( this_arg : * const c_void , local_commitment_tx : & crate :: ln:: chan_utils:: LocalCommitmentTransaction ) -> crate :: c_types:: derived:: CResult_CVec_SignatureZNoneZ {
766
+ extern "C" fn InMemoryChannelKeys_ChannelKeys_sign_holder_commitment_htlc_transactions ( this_arg : * const c_void , local_commitment_tx : & crate :: ln:: chan_utils:: HolderCommitmentTransaction ) -> crate :: c_types:: derived:: CResult_CVec_SignatureZNoneZ {
767
767
let mut ret = unsafe { & mut * ( this_arg as * mut nativeInMemoryChannelKeys ) } . sign_holder_commitment_htlc_transactions ( unsafe { & * local_commitment_tx. inner } , & bitcoin:: secp256k1:: Secp256k1 :: new ( ) ) ;
768
768
let mut local_ret = match ret { Ok ( mut o) => crate :: c_types:: CResultTempl :: ok ( { let mut local_ret_0 = Vec :: new ( ) ; for item in o. drain ( ..) { local_ret_0. push ( { let mut local_ret_0_0 = if item. is_none ( ) { crate :: c_types:: Signature :: null ( ) } else { { crate :: c_types:: Signature :: from_rust ( & ( item. unwrap ( ) ) ) } } ; local_ret_0_0 } ) ; } ; local_ret_0. into ( ) } ) , Err ( mut e) => crate :: c_types:: CResultTempl :: err ( { 0u8 /*e*/ } ) } ;
769
769
local_ret
0 commit comments