@@ -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:: sync:: { Arc , Condvar , Mutex , RwLock } ;
@@ -158,14 +158,14 @@ where
158
158
}
159
159
160
160
pub ( crate ) fn create_funding_transaction (
161
- & self , output_script : Script , value_sats : u64 , confirmation_target : ConfirmationTarget ,
161
+ & self , output_script : Script , value_sats : u64 , confirmation_target : ConfirmationTarget , locktime : LockTime ,
162
162
) -> Result < Transaction , Error > {
163
163
let fee_rate = self . estimate_fee_rate ( confirmation_target) ;
164
164
165
165
let locked_wallet = self . inner . lock ( ) . unwrap ( ) ;
166
166
let mut tx_builder = locked_wallet. build_tx ( ) ;
167
167
168
- tx_builder. add_recipient ( output_script, value_sats) . fee_rate ( fee_rate) . enable_rbf ( ) ;
168
+ tx_builder. add_recipient ( output_script, value_sats) . fee_rate ( fee_rate) . nlocktime ( locktime ) . enable_rbf ( ) ;
169
169
170
170
let mut psbt = match tx_builder. finish ( ) {
171
171
Ok ( ( psbt, _) ) => {
@@ -365,7 +365,7 @@ where
365
365
pub fn spend_spendable_outputs < C : Signing > (
366
366
& self , descriptors : & [ & SpendableOutputDescriptor ] , outputs : Vec < TxOut > ,
367
367
change_destination_script : Script , feerate_sat_per_1000_weight : u32 ,
368
- secp_ctx : & Secp256k1 < C > ,
368
+ locktime : Option < PackedLockTime > , secp_ctx : & Secp256k1 < C > ,
369
369
) -> Result < Transaction , ( ) > {
370
370
let only_non_static = & descriptors
371
371
. iter ( )
@@ -377,6 +377,7 @@ where
377
377
outputs,
378
378
change_destination_script,
379
379
feerate_sat_per_1000_weight,
380
+ locktime,
380
381
secp_ctx,
381
382
)
382
383
}
0 commit comments