@@ -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, _) ) => {
@@ -372,7 +372,7 @@ where
372
372
pub fn spend_spendable_outputs < C : Signing > (
373
373
& self , descriptors : & [ & SpendableOutputDescriptor ] , outputs : Vec < TxOut > ,
374
374
change_destination_script : Script , feerate_sat_per_1000_weight : u32 ,
375
- secp_ctx : & Secp256k1 < C > ,
375
+ locktime : Option < PackedLockTime > , secp_ctx : & Secp256k1 < C > ,
376
376
) -> Result < Transaction , ( ) > {
377
377
let only_non_static = & descriptors
378
378
. iter ( )
@@ -384,6 +384,7 @@ where
384
384
outputs,
385
385
change_destination_script,
386
386
feerate_sat_per_1000_weight,
387
+ locktime,
387
388
secp_ctx,
388
389
)
389
390
}
0 commit comments