@@ -91,14 +91,6 @@ impl AnchorDescriptor {
9191 let channel_params = self . channel_derivation_parameters . transaction_parameters . as_holder_broadcastable ( ) ;
9292 chan_utils:: build_anchor_input_witness ( & channel_params. broadcaster_pubkeys ( ) . funding_pubkey , signature)
9393 }
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- }
10294}
10395
10496/// Represents the different types of transactions, originating from LDK, to be bumped.
@@ -118,7 +110,7 @@ pub enum BumpTransactionEvent {
118110 ///
119111 /// The consumer should be able to sign for any of the additional inputs included within the
120112 /// 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
122114 /// can be computed with [`EcdsaChannelSigner::sign_holder_anchor_input`], which can then be
123115 /// provided to [`build_anchor_input_witness`] along with the `funding_pubkey` to obtain the
124116 /// full witness required to spend.
@@ -183,7 +175,7 @@ pub enum BumpTransactionEvent {
183175 ///
184176 /// The consumer should be able to sign for any of the non-HTLC inputs added to the resulting
185177 /// 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
187179 /// computed with [`EcdsaChannelSigner::sign_holder_htlc_transaction`], which can then be
188180 /// provided to [`HTLCDescriptor::tx_input_witness`] to obtain the fully signed witness required
189181 /// to spend.
@@ -684,7 +676,7 @@ where
684676 log_debug ! ( self . logger, "Signing anchor transaction {}" , anchor_txid) ;
685677 anchor_tx = self . utxo_source . sign_psbt ( anchor_psbt) ?;
686678
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 ) ;
688680 let channel_parameters = & anchor_descriptor. channel_derivation_parameters . transaction_parameters ;
689681 let anchor_sig = signer. sign_holder_anchor_input ( channel_parameters, & anchor_tx, 0 , & self . secp ) ?;
690682 anchor_tx. input [ 0 ] . witness = anchor_descriptor. tx_input_witness ( & anchor_sig) ;
@@ -787,8 +779,9 @@ where
787779
788780 let mut signers = BTreeMap :: new ( ) ;
789781 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) ) ;
792785 let htlc_sig = signer. sign_holder_htlc_transaction ( & htlc_tx, idx, htlc_descriptor, & self . secp ) ?;
793786 let witness_script = htlc_descriptor. witness_script ( & self . secp ) ;
794787 htlc_tx. input [ idx] . witness = htlc_descriptor. tx_input_witness ( & htlc_sig, & witness_script) ;
0 commit comments