fix pruning (#101)

* fix pruning
This commit is contained in:
0g-peterzhb 2024-06-30 08:31:06 +08:00 committed by GitHub
parent 4eb2a50b0e
commit 2f3361fafc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -80,6 +80,14 @@ impl FlowStore {
} }
pub fn delete_batch_list(&self, batch_list: &[u64]) -> Result<()> { 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) self.db.delete_batch_list(batch_list)
} }
} }