@@ -30,7 +30,6 @@ use bitcoin::blockdata::locktime::absolute::LockTime;
30
30
use bitcoin:: secp256k1:: Secp256k1 ;
31
31
use bitcoin:: { BlockHash , Transaction , Txid } ;
32
32
33
- use core:: cmp;
34
33
use core:: ops:: Deref ;
35
34
36
35
/// The state of a spendable output currently tracked by an [`OutputSweeper`].
@@ -395,13 +394,13 @@ where
395
394
/// [`SpendableOutputDescriptor::StaticOutput`]s, which may be handled directly by the on-chain
396
395
/// wallet implementation.
397
396
///
398
- /// If `delay_spend ` is configured , we will delay the spending until the respective block
397
+ /// If `delay_until_height ` is set , we will delay the spending until the respective block
399
398
/// height is reached. This can be used to batch spends, e.g., to reduce on-chain fees.
400
399
///
401
400
/// [`Event::SpendableOutputs`]: crate::events::Event::SpendableOutputs
402
401
pub fn track_spendable_outputs (
403
402
& self , output_descriptors : Vec < SpendableOutputDescriptor > , channel_id : Option < ChannelId > ,
404
- exclude_static_ouputs : bool , delay_spend : Option < SpendingDelay > ,
403
+ exclude_static_ouputs : bool , delay_until_height : Option < u32 > ,
405
404
) {
406
405
let mut relevant_descriptors = output_descriptors
407
406
. into_iter ( )
@@ -418,16 +417,13 @@ where
418
417
let mut spending_tx_opt;
419
418
{
420
419
let mut state_lock = self . sweeper_state . lock ( ) . unwrap ( ) ;
421
- let cur_height = state_lock. best_block . height ;
422
- let delayed_until_height = delay_spend. map ( |delay| match delay {
423
- SpendingDelay :: Relative { num_blocks } => cur_height + num_blocks,
424
- SpendingDelay :: Absolute { height } => cmp:: max ( height, cur_height) ,
425
- } ) ;
426
420
for descriptor in relevant_descriptors {
427
421
let output_info = TrackedSpendableOutput {
428
422
descriptor,
429
423
channel_id,
430
- status : OutputSpendStatus :: PendingInitialBroadcast { delayed_until_height } ,
424
+ status : OutputSpendStatus :: PendingInitialBroadcast {
425
+ delayed_until_height : delay_until_height,
426
+ } ,
431
427
} ;
432
428
433
429
if state_lock
0 commit comments