@@ -22,7 +22,7 @@ use bitcoin::bech32::u5;
22
22
use bitcoin:: secp256k1:: ecdh:: SharedSecret ;
23
23
use bitcoin:: secp256k1:: ecdsa:: { RecoverableSignature , Signature } ;
24
24
use bitcoin:: secp256k1:: { PublicKey , Scalar , Secp256k1 , Signing } ;
25
- use bitcoin:: { Script , Transaction , TxOut , Txid } ;
25
+ use bitcoin:: { PackedLockTime , LockTime , Script , Transaction , TxOut , Txid } ;
26
26
27
27
use std:: collections:: HashMap ;
28
28
use std:: sync:: { Arc , Condvar , Mutex , RwLock } ;
@@ -156,14 +156,14 @@ where
156
156
}
157
157
158
158
pub ( crate ) fn create_funding_transaction (
159
- & self , output_script : Script , value_sats : u64 , confirmation_target : ConfirmationTarget ,
159
+ & self , output_script : Script , value_sats : u64 , confirmation_target : ConfirmationTarget , locktime : LockTime ,
160
160
) -> Result < Transaction , Error > {
161
161
let fee_rate = self . estimate_fee_rate ( confirmation_target) ;
162
162
163
163
let locked_wallet = self . inner . lock ( ) . unwrap ( ) ;
164
164
let mut tx_builder = locked_wallet. build_tx ( ) ;
165
165
166
- tx_builder. add_recipient ( output_script, value_sats) . fee_rate ( fee_rate) . enable_rbf ( ) ;
166
+ tx_builder. add_recipient ( output_script, value_sats) . fee_rate ( fee_rate) . nlocktime ( locktime ) . enable_rbf ( ) ;
167
167
168
168
let mut psbt = match tx_builder. finish ( ) {
169
169
Ok ( ( psbt, _) ) => {
@@ -363,7 +363,7 @@ where
363
363
pub fn spend_spendable_outputs < C : Signing > (
364
364
& self , descriptors : & [ & SpendableOutputDescriptor ] , outputs : Vec < TxOut > ,
365
365
change_destination_script : Script , feerate_sat_per_1000_weight : u32 ,
366
- secp_ctx : & Secp256k1 < C > ,
366
+ locktime : Option < PackedLockTime > , secp_ctx : & Secp256k1 < C > ,
367
367
) -> Result < Transaction , ( ) > {
368
368
let only_non_static = & descriptors
369
369
. iter ( )
@@ -375,6 +375,7 @@ where
375
375
outputs,
376
376
change_destination_script,
377
377
feerate_sat_per_1000_weight,
378
+ locktime,
378
379
secp_ctx,
379
380
)
380
381
}
0 commit comments