@@ -41,7 +41,6 @@ use bitcoin::{secp256k1, Sequence, Witness};
4141
4242use crate :: io;
4343use core:: cmp;
44- use crate :: ln:: chan_utils;
4544use crate :: util:: transaction_utils:: sort_outputs;
4645use crate :: ln:: channel:: { INITIAL_COMMITMENT_NUMBER , ANCHOR_OUTPUT_VALUE_SATOSHI } ;
4746use core:: ops:: Deref ;
@@ -810,15 +809,15 @@ pub fn get_anchor_redeemscript(funding_pubkey: &PublicKey) -> ScriptBuf {
810809
811810/// Locates the output with an anchor script paying to `funding_pubkey` within `commitment_tx`.
812811pub ( crate ) fn get_anchor_output < ' a > ( commitment_tx : & ' a Transaction , funding_pubkey : & PublicKey ) -> Option < ( u32 , & ' a TxOut ) > {
813- let anchor_script = chan_utils :: get_anchor_redeemscript ( funding_pubkey) . to_p2wsh ( ) ;
812+ let anchor_script = get_anchor_redeemscript ( funding_pubkey) . to_p2wsh ( ) ;
814813 commitment_tx. output . iter ( ) . enumerate ( )
815814 . find ( |( _, txout) | txout. script_pubkey == anchor_script)
816815 . map ( |( idx, txout) | ( idx as u32 , txout) )
817816}
818817
819818/// Returns the witness required to satisfy and spend an anchor input.
820819pub fn build_anchor_input_witness ( funding_key : & PublicKey , funding_sig : & Signature ) -> Witness {
821- let anchor_redeem_script = chan_utils :: get_anchor_redeemscript ( funding_key) ;
820+ let anchor_redeem_script = get_anchor_redeemscript ( funding_key) ;
822821 let mut ret = Witness :: new ( ) ;
823822 ret. push_ecdsa_signature ( & BitcoinSignature :: sighash_all ( * funding_sig) ) ;
824823 ret. push ( anchor_redeem_script. as_bytes ( ) ) ;
@@ -1510,7 +1509,7 @@ impl CommitmentTransaction {
15101509
15111510 let mut htlcs = Vec :: with_capacity ( htlcs_with_aux. len ( ) ) ;
15121511 for ( htlc, _) in htlcs_with_aux {
1513- let script = chan_utils :: get_htlc_redeemscript ( & htlc, & channel_parameters. channel_type_features ( ) , & keys) ;
1512+ let script = get_htlc_redeemscript ( & htlc, & channel_parameters. channel_type_features ( ) , & keys) ;
15141513 let txout = TxOut {
15151514 script_pubkey : script. to_p2wsh ( ) ,
15161515 value : htlc. to_bitcoin_amount ( ) ,
@@ -1733,7 +1732,7 @@ impl<'a> TrustedCommitmentTransaction<'a> {
17331732 & self . inner . htlcs [ htlc_index] , & self . channel_type_features , & keys. broadcaster_htlc_key ,
17341733 & keys. countersignatory_htlc_key , & keys. revocation_key
17351734 ) ;
1736- chan_utils :: build_htlc_input_witness (
1735+ build_htlc_input_witness (
17371736 signature, counterparty_signature, preimage, & htlc_redeemscript, & self . channel_type_features ,
17381737 )
17391738 }
0 commit comments