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