Skip to content

Commit e0607bb

Browse files
committed
f Lower-bound absolute spending delay
1 parent 18bb1c1 commit e0607bb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lightning/src/util/sweep.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ use bitcoin::blockdata::locktime::absolute::LockTime;
3030
use bitcoin::secp256k1::Secp256k1;
3131
use bitcoin::{BlockHash, Transaction, Txid};
3232

33+
use core::cmp;
3334
use core::ops::Deref;
3435

3536
/// The state of a spendable output currently tracked by an [`OutputSweeper`].
@@ -420,7 +421,7 @@ where
420421
let cur_height = state_lock.best_block.height;
421422
let delayed_until_height = delay_spend.map(|delay| match delay {
422423
SpendingDelay::Relative { num_blocks } => cur_height + num_blocks,
423-
SpendingDelay::Absolute { height } => height,
424+
SpendingDelay::Absolute { height } => cmp::max(height, cur_height),
424425
});
425426
for descriptor in relevant_descriptors {
426427
let output_info = TrackedSpendableOutput {

0 commit comments

Comments
 (0)