@@ -24,7 +24,7 @@ use bitcoin::bech32::u5;
24
24
use bitcoin:: secp256k1:: ecdh:: SharedSecret ;
25
25
use bitcoin:: secp256k1:: ecdsa:: { RecoverableSignature , Signature } ;
26
26
use bitcoin:: secp256k1:: { PublicKey , Scalar , Secp256k1 , Signing } ;
27
- use bitcoin:: { Script , Transaction , TxOut , Txid } ;
27
+ use bitcoin:: { PackedLockTime , LockTime , Script , Transaction , TxOut , Txid } ;
28
28
29
29
use std:: collections:: HashMap ;
30
30
use std:: ops:: Deref ;
@@ -153,14 +153,14 @@ where
153
153
}
154
154
155
155
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 ,
157
157
) -> Result < Transaction , Error > {
158
158
let fee_rate = self . estimate_fee_rate ( confirmation_target) ;
159
159
160
160
let locked_wallet = self . inner . lock ( ) . unwrap ( ) ;
161
161
let mut tx_builder = locked_wallet. build_tx ( ) ;
162
162
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 ( ) ;
164
164
165
165
let mut psbt = match tx_builder. finish ( ) {
166
166
Ok ( ( psbt, _) ) => {
@@ -374,7 +374,7 @@ where
374
374
pub fn spend_spendable_outputs < C : Signing > (
375
375
& self , descriptors : & [ & SpendableOutputDescriptor ] , outputs : Vec < TxOut > ,
376
376
change_destination_script : Script , feerate_sat_per_1000_weight : u32 ,
377
- secp_ctx : & Secp256k1 < C > ,
377
+ locktime : Option < PackedLockTime > , secp_ctx : & Secp256k1 < C > ,
378
378
) -> Result < Transaction , ( ) > {
379
379
let only_non_static = & descriptors
380
380
. iter ( )
@@ -386,6 +386,7 @@ where
386
386
outputs,
387
387
change_destination_script,
388
388
feerate_sat_per_1000_weight,
389
+ locktime,
389
390
secp_ctx,
390
391
)
391
392
}
0 commit comments