@@ -91,14 +91,6 @@ impl AnchorDescriptor {
91
91
let channel_params = self . channel_derivation_parameters . transaction_parameters . as_holder_broadcastable ( ) ;
92
92
chan_utils:: build_anchor_input_witness ( & channel_params. broadcaster_pubkeys ( ) . funding_pubkey , signature)
93
93
}
94
-
95
- /// Derives the channel signer required to sign the anchor input.
96
- pub fn derive_channel_signer < S : EcdsaChannelSigner , SP : Deref > ( & self , signer_provider : & SP ) -> S
97
- where
98
- SP :: Target : SignerProvider < EcdsaSigner = S >
99
- {
100
- signer_provider. derive_channel_signer ( self . channel_derivation_parameters . keys_id )
101
- }
102
94
}
103
95
104
96
/// Represents the different types of transactions, originating from LDK, to be bumped.
@@ -118,7 +110,7 @@ pub enum BumpTransactionEvent {
118
110
///
119
111
/// The consumer should be able to sign for any of the additional inputs included within the
120
112
/// child anchor transaction. To sign its anchor input, an [`EcdsaChannelSigner`] should be
121
- /// re-derived through [`AnchorDescriptor ::derive_channel_signer`]. The anchor input signature
113
+ /// re-derived through [`SignerProvider ::derive_channel_signer`]. The anchor input signature
122
114
/// can be computed with [`EcdsaChannelSigner::sign_holder_anchor_input`], which can then be
123
115
/// provided to [`build_anchor_input_witness`] along with the `funding_pubkey` to obtain the
124
116
/// full witness required to spend.
@@ -183,7 +175,7 @@ pub enum BumpTransactionEvent {
183
175
///
184
176
/// The consumer should be able to sign for any of the non-HTLC inputs added to the resulting
185
177
/// HTLC transaction. To sign HTLC inputs, an [`EcdsaChannelSigner`] should be re-derived
186
- /// through [`HTLCDescriptor ::derive_channel_signer`]. Each HTLC input's signature can be
178
+ /// through [`SignerProvider ::derive_channel_signer`]. Each HTLC input's signature can be
187
179
/// computed with [`EcdsaChannelSigner::sign_holder_htlc_transaction`], which can then be
188
180
/// provided to [`HTLCDescriptor::tx_input_witness`] to obtain the fully signed witness required
189
181
/// to spend.
@@ -684,7 +676,7 @@ where
684
676
log_debug ! ( self . logger, "Signing anchor transaction {}" , anchor_txid) ;
685
677
anchor_tx = self . utxo_source . sign_psbt ( anchor_psbt) ?;
686
678
687
- let signer = anchor_descriptor . derive_channel_signer ( & self . signer_provider ) ;
679
+ let signer = self . signer_provider . derive_channel_signer ( anchor_descriptor . channel_derivation_parameters . keys_id ) ;
688
680
let channel_parameters = & anchor_descriptor. channel_derivation_parameters . transaction_parameters ;
689
681
let anchor_sig = signer. sign_holder_anchor_input ( channel_parameters, & anchor_tx, 0 , & self . secp ) ?;
690
682
anchor_tx. input [ 0 ] . witness = anchor_descriptor. tx_input_witness ( & anchor_sig) ;
@@ -787,8 +779,9 @@ where
787
779
788
780
let mut signers = BTreeMap :: new ( ) ;
789
781
for ( idx, htlc_descriptor) in htlc_descriptors. iter ( ) . enumerate ( ) {
790
- let signer = signers. entry ( htlc_descriptor. channel_derivation_parameters . keys_id )
791
- . or_insert_with ( || htlc_descriptor. derive_channel_signer ( & self . signer_provider ) ) ;
782
+ let keys_id = htlc_descriptor. channel_derivation_parameters . keys_id ;
783
+ let signer = signers. entry ( keys_id)
784
+ . or_insert_with ( || self . signer_provider . derive_channel_signer ( keys_id) ) ;
792
785
let htlc_sig = signer. sign_holder_htlc_transaction ( & htlc_tx, idx, htlc_descriptor, & self . secp ) ?;
793
786
let witness_script = htlc_descriptor. witness_script ( & self . secp ) ;
794
787
htlc_tx. input [ idx] . witness = htlc_descriptor. tx_input_witness ( & htlc_sig, & witness_script) ;
0 commit comments