@@ -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:: { LockTime , PackedLockTime , Script , Transaction , TxOut , Txid } ;
28
28
29
29
use std:: collections:: HashMap ;
30
30
use std:: ops:: Deref ;
@@ -154,13 +154,18 @@ where
154
154
155
155
pub ( crate ) fn create_funding_transaction (
156
156
& self , output_script : Script , value_sats : u64 , confirmation_target : ConfirmationTarget ,
157
+ locktime : LockTime ,
157
158
) -> Result < Transaction , Error > {
158
159
let fee_rate = self . estimate_fee_rate ( confirmation_target) ;
159
160
160
161
let locked_wallet = self . inner . lock ( ) . unwrap ( ) ;
161
162
let mut tx_builder = locked_wallet. build_tx ( ) ;
162
163
163
- tx_builder. add_recipient ( output_script, value_sats) . fee_rate ( fee_rate) . enable_rbf ( ) ;
164
+ tx_builder
165
+ . add_recipient ( output_script, value_sats)
166
+ . fee_rate ( fee_rate)
167
+ . nlocktime ( locktime)
168
+ . enable_rbf ( ) ;
164
169
165
170
let mut psbt = match tx_builder. finish ( ) {
166
171
Ok ( ( psbt, _) ) => {
@@ -372,7 +377,7 @@ where
372
377
pub fn spend_spendable_outputs < C : Signing > (
373
378
& self , descriptors : & [ & SpendableOutputDescriptor ] , outputs : Vec < TxOut > ,
374
379
change_destination_script : Script , feerate_sat_per_1000_weight : u32 ,
375
- secp_ctx : & Secp256k1 < C > ,
380
+ locktime : Option < PackedLockTime > , secp_ctx : & Secp256k1 < C > ,
376
381
) -> Result < Option < Transaction > , ( ) > {
377
382
let only_non_static = & descriptors
378
383
. iter ( )
@@ -388,6 +393,7 @@ where
388
393
outputs,
389
394
change_destination_script,
390
395
feerate_sat_per_1000_weight,
396
+ locktime,
391
397
secp_ctx,
392
398
)
393
399
. map ( Some )
0 commit comments