@@ -24,7 +24,7 @@ use bitcoin::bech32::u5;
2424use bitcoin:: secp256k1:: ecdh:: SharedSecret ;
2525use bitcoin:: secp256k1:: ecdsa:: { RecoverableSignature , Signature } ;
2626use bitcoin:: secp256k1:: { PublicKey , Scalar , Secp256k1 , Signing } ;
27- use bitcoin:: { Script , Transaction , TxOut , Txid } ;
27+ use bitcoin:: { PackedLockTime , LockTime , Script , Transaction , TxOut , Txid } ;
2828
2929use std:: collections:: HashMap ;
3030use std:: ops:: Deref ;
@@ -153,14 +153,14 @@ where
153153 }
154154
155155 pub ( crate ) fn create_funding_transaction (
156- & self , output_script : Script , value_sats : u64 , confirmation_target : ConfirmationTarget ,
156+ & self , output_script : Script , value_sats : u64 , confirmation_target : ConfirmationTarget , locktime : LockTime ,
157157 ) -> Result < Transaction , Error > {
158158 let fee_rate = self . estimate_fee_rate ( confirmation_target) ;
159159
160160 let locked_wallet = self . inner . lock ( ) . unwrap ( ) ;
161161 let mut tx_builder = locked_wallet. build_tx ( ) ;
162162
163- tx_builder. add_recipient ( output_script, value_sats) . fee_rate ( fee_rate) . enable_rbf ( ) ;
163+ tx_builder. add_recipient ( output_script, value_sats) . fee_rate ( fee_rate) . nlocktime ( locktime ) . enable_rbf ( ) ;
164164
165165 let mut psbt = match tx_builder. finish ( ) {
166166 Ok ( ( psbt, _) ) => {
@@ -372,7 +372,7 @@ where
372372 pub fn spend_spendable_outputs < C : Signing > (
373373 & self , descriptors : & [ & SpendableOutputDescriptor ] , outputs : Vec < TxOut > ,
374374 change_destination_script : Script , feerate_sat_per_1000_weight : u32 ,
375- secp_ctx : & Secp256k1 < C > ,
375+ locktime : Option < PackedLockTime > , secp_ctx : & Secp256k1 < C > ,
376376 ) -> Result < Transaction , ( ) > {
377377 let only_non_static = & descriptors
378378 . iter ( )
@@ -384,6 +384,7 @@ where
384384 outputs,
385385 change_destination_script,
386386 feerate_sat_per_1000_weight,
387+ locktime,
387388 secp_ctx,
388389 )
389390 }
0 commit comments