@@ -33,7 +33,7 @@ use util::ser::{Writeable, Writer, Readable};
33
33
34
34
use chain:: transaction:: OutPoint ;
35
35
use ln:: chan_utils;
36
- use ln:: chan_utils:: { HTLCOutputInCommitment , make_funding_redeemscript, ChannelPublicKeys , LocalCommitmentTransaction , PreCalculatedTxCreationKeys } ;
36
+ use ln:: chan_utils:: { HTLCOutputInCommitment , make_funding_redeemscript, ChannelPublicKeys , HolderCommitmentTransaction , PreCalculatedTxCreationKeys } ;
37
37
use ln:: msgs:: UnsignedChannelAnnouncement ;
38
38
39
39
use std:: sync:: atomic:: { AtomicUsize , Ordering } ;
@@ -242,14 +242,14 @@ pub trait ChannelKeys : Send+Clone {
242
242
//
243
243
// TODO: Document the things someone using this interface should enforce before signing.
244
244
// TODO: Add more input vars to enable better checking (preferably removing commitment_tx and
245
- fn sign_holder_commitment < T : secp256k1:: Signing + secp256k1:: Verification > ( & self , holder_commitment_tx : & LocalCommitmentTransaction , secp_ctx : & Secp256k1 < T > ) -> Result < Signature , ( ) > ;
245
+ fn sign_holder_commitment < T : secp256k1:: Signing + secp256k1:: Verification > ( & self , holder_commitment_tx : & HolderCommitmentTransaction , secp_ctx : & Secp256k1 < T > ) -> Result < Signature , ( ) > ;
246
246
247
247
/// Same as sign_holder_commitment, but exists only for tests to get access to holder commitment
248
248
/// transactions which will be broadcasted later, after the channel has moved on to a newer
249
249
/// state. Thus, needs its own method as sign_holder_commitment may enforce that we only ever
250
250
/// get called once.
251
251
#[ cfg( any( test, feature = "unsafe_revoked_tx_signing" ) ) ]
252
- fn unsafe_sign_holder_commitment < T : secp256k1:: Signing + secp256k1:: Verification > ( & self , holder_commitment_tx : & LocalCommitmentTransaction , secp_ctx : & Secp256k1 < T > ) -> Result < Signature , ( ) > ;
252
+ fn unsafe_sign_holder_commitment < T : secp256k1:: Signing + secp256k1:: Verification > ( & self , holder_commitment_tx : & HolderCommitmentTransaction , secp_ctx : & Secp256k1 < T > ) -> Result < Signature , ( ) > ;
253
253
254
254
/// Create a signature for each HTLC transaction spending a holder's commitment transaction.
255
255
///
@@ -264,7 +264,7 @@ pub trait ChannelKeys : Send+Clone {
264
264
/// (implying they were considered dust at the time the commitment transaction was negotiated),
265
265
/// a corresponding None should be included in the return value. All other positions in the
266
266
/// return value must contain a signature.
267
- fn sign_holder_commitment_htlc_transactions < T : secp256k1:: Signing + secp256k1:: Verification > ( & self , holder_commitment_tx : & LocalCommitmentTransaction , secp_ctx : & Secp256k1 < T > ) -> Result < Vec < Option < Signature > > , ( ) > ;
267
+ fn sign_holder_commitment_htlc_transactions < T : secp256k1:: Signing + secp256k1:: Verification > ( & self , holder_commitment_tx : & HolderCommitmentTransaction , secp_ctx : & Secp256k1 < T > ) -> Result < Vec < Option < Signature > > , ( ) > ;
268
268
269
269
/// Create a signature for the given input in a transaction spending an HTLC or commitment
270
270
/// transaction output when our counterparty broadcasts an old state.
@@ -499,24 +499,24 @@ impl ChannelKeys for InMemoryChannelKeys {
499
499
Ok ( ( commitment_sig, htlc_sigs) )
500
500
}
501
501
502
- fn sign_holder_commitment < T : secp256k1:: Signing + secp256k1:: Verification > ( & self , holder_commitment_tx : & LocalCommitmentTransaction , secp_ctx : & Secp256k1 < T > ) -> Result < Signature , ( ) > {
502
+ fn sign_holder_commitment < T : secp256k1:: Signing + secp256k1:: Verification > ( & self , holder_commitment_tx : & HolderCommitmentTransaction , secp_ctx : & Secp256k1 < T > ) -> Result < Signature , ( ) > {
503
503
let funding_pubkey = PublicKey :: from_secret_key ( secp_ctx, & self . funding_key ) ;
504
504
let counterparty_channel_data = self . accepted_channel_data . as_ref ( ) . expect ( "must accept before signing" ) ;
505
505
let channel_funding_redeemscript = make_funding_redeemscript ( & funding_pubkey, & counterparty_channel_data. counterparty_channel_pubkeys . funding_pubkey ) ;
506
506
507
- Ok ( holder_commitment_tx. get_local_sig ( & self . funding_key , & channel_funding_redeemscript, self . channel_value_satoshis , secp_ctx) )
507
+ Ok ( holder_commitment_tx. get_holder_sig ( & self . funding_key , & channel_funding_redeemscript, self . channel_value_satoshis , secp_ctx) )
508
508
}
509
509
510
510
#[ cfg( any( test, feature = "unsafe_revoked_tx_signing" ) ) ]
511
- fn unsafe_sign_holder_commitment < T : secp256k1:: Signing + secp256k1:: Verification > ( & self , holder_commitment_tx : & LocalCommitmentTransaction , secp_ctx : & Secp256k1 < T > ) -> Result < Signature , ( ) > {
511
+ fn unsafe_sign_holder_commitment < T : secp256k1:: Signing + secp256k1:: Verification > ( & self , holder_commitment_tx : & HolderCommitmentTransaction , secp_ctx : & Secp256k1 < T > ) -> Result < Signature , ( ) > {
512
512
let funding_pubkey = PublicKey :: from_secret_key ( secp_ctx, & self . funding_key ) ;
513
513
let counterparty_channel_pubkeys = & self . accepted_channel_data . as_ref ( ) . expect ( "must accept before signing" ) . counterparty_channel_pubkeys ;
514
514
let channel_funding_redeemscript = make_funding_redeemscript ( & funding_pubkey, & counterparty_channel_pubkeys. funding_pubkey ) ;
515
515
516
- Ok ( holder_commitment_tx. get_local_sig ( & self . funding_key , & channel_funding_redeemscript, self . channel_value_satoshis , secp_ctx) )
516
+ Ok ( holder_commitment_tx. get_holder_sig ( & self . funding_key , & channel_funding_redeemscript, self . channel_value_satoshis , secp_ctx) )
517
517
}
518
518
519
- fn sign_holder_commitment_htlc_transactions < T : secp256k1:: Signing + secp256k1:: Verification > ( & self , holder_commitment_tx : & LocalCommitmentTransaction , secp_ctx : & Secp256k1 < T > ) -> Result < Vec < Option < Signature > > , ( ) > {
519
+ fn sign_holder_commitment_htlc_transactions < T : secp256k1:: Signing + secp256k1:: Verification > ( & self , holder_commitment_tx : & HolderCommitmentTransaction , secp_ctx : & Secp256k1 < T > ) -> Result < Vec < Option < Signature > > , ( ) > {
520
520
let counterparty_selected_contest_delay = self . accepted_channel_data . as_ref ( ) . unwrap ( ) . counterparty_selected_contest_delay ;
521
521
holder_commitment_tx. get_htlc_sigs ( & self . htlc_base_key , counterparty_selected_contest_delay, secp_ctx)
522
522
}
0 commit comments