@@ -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, _) ) => {
@@ -374,7 +374,7 @@ where
374374 pub fn spend_spendable_outputs < C : Signing > (
375375 & self , descriptors : & [ & SpendableOutputDescriptor ] , outputs : Vec < TxOut > ,
376376 change_destination_script : Script , feerate_sat_per_1000_weight : u32 ,
377- secp_ctx : & Secp256k1 < C > ,
377+ locktime : Option < PackedLockTime > , secp_ctx : & Secp256k1 < C > ,
378378 ) -> Result < Transaction , ( ) > {
379379 let only_non_static = & descriptors
380380 . iter ( )
@@ -386,6 +386,7 @@ where
386386 outputs,
387387 change_destination_script,
388388 feerate_sat_per_1000_weight,
389+ locktime,
389390 secp_ctx,
390391 )
391392 }
0 commit comments