mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-01-29 17:18:08 -05:00
fix(provider): update checkpoints only for known stages (#3624)
This commit is contained in:
@@ -1227,14 +1227,15 @@ impl<'this, TX: DbTxMut<'this>> StageCheckpointWriter for DatabaseProvider<'this
|
||||
) -> Result<()> {
|
||||
// iterate over all existing stages in the table and update its progress.
|
||||
let mut cursor = self.tx.cursor_write::<tables::SyncStage>()?;
|
||||
while let Some((stage_name, checkpoint)) = cursor.next()? {
|
||||
for stage_id in StageId::ALL {
|
||||
let (_, checkpoint) = cursor.seek_exact(stage_id.to_string())?.unwrap_or_default();
|
||||
cursor.upsert(
|
||||
stage_name,
|
||||
stage_id.to_string(),
|
||||
StageCheckpoint {
|
||||
block_number,
|
||||
..if drop_stage_checkpoint { Default::default() } else { checkpoint }
|
||||
},
|
||||
)?
|
||||
)?;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
||||
Reference in New Issue
Block a user