From d46a6ff8e97a9cfcd897d822449008703ed378c7 Mon Sep 17 00:00:00 2001 From: Matt Bell Date: Mon, 5 Feb 2024 15:04:30 -0600 Subject: [PATCH] Set backfill sigset create_time to prevent instant checkpoint pruning --- src/bitcoin/checkpoint.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/bitcoin/checkpoint.rs b/src/bitcoin/checkpoint.rs index fa23d30d3..dcad3f1e1 100644 --- a/src/bitcoin/checkpoint.rs +++ b/src/bitcoin/checkpoint.rs @@ -2375,6 +2375,8 @@ impl CheckpointQueue { ) -> Result<()> { let mut index = first_index; + let create_time = self.queue.get(0)?.unwrap().create_time(); + for script in redeem_scripts { if index >= self.first_index()? { index -= 1; @@ -2383,6 +2385,7 @@ impl CheckpointQueue { let (mut sigset, _) = SignatorySet::from_script(&script)?; sigset.index = index; + sigset.create_time = create_time; let cp = Checkpoint::new(sigset)?; self.queue.push_front(cp)?;