From 2f3361fafc5ddddee8b6e2e1d27fad89e9ec52d1 Mon Sep 17 00:00:00 2001 From: 0g-peterzhb <158457852+0g-peterzhb@users.noreply.github.com> Date: Sun, 30 Jun 2024 08:31:06 +0800 Subject: [PATCH] fix pruning (#101) * fix pruning --- node/storage/src/log_store/flow_store.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/node/storage/src/log_store/flow_store.rs b/node/storage/src/log_store/flow_store.rs index 64fbe20..8c2fae9 100644 --- a/node/storage/src/log_store/flow_store.rs +++ b/node/storage/src/log_store/flow_store.rs @@ -80,6 +80,14 @@ impl FlowStore { } pub fn delete_batch_list(&self, batch_list: &[u64]) -> Result<()> { + let mut to_seal_set = self.to_seal_set.write(); + for batch_index in batch_list { + for seal_index in (*batch_index as usize) * SEALS_PER_LOAD + ..(*batch_index as usize + 1) * SEALS_PER_LOAD + { + to_seal_set.remove(&seal_index); + } + } self.db.delete_batch_list(batch_list) } }