Skip to content

Commit 93131ea

Browse files
committed
f Lower-bound absolute spending delay
1 parent ffc34e3 commit 93131ea

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`].
@@ -448,7 +449,7 @@ where
448449
let cur_height = state_lock.best_block.height;
449450
let delayed_until_height = delay_spend.map(|delay| match delay {
450451
SpendingDelay::Relative { num_blocks } => cur_height + num_blocks,
451-
SpendingDelay::Absolute { height } => height,
452+
SpendingDelay::Absolute { height } => cmp::max(height, cur_height),
452453
});
453454
for descriptor in relevant_descriptors {
454455
let output_info = TrackedSpendableOutput {

0 commit comments

Comments
 (0)