Skip to content

Commit

Permalink
fix: dont sync if nothing in onchain db
Browse files Browse the repository at this point in the history
  • Loading branch information
rymnc committed Sep 23, 2024
1 parent 9575a21 commit e5f5d92
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions crates/fuel-core/src/combined_database.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,12 +316,11 @@ impl CombinedDatabase {
where
S: ShutdownListener,
{
let on_chain_height = self
.on_chain()
.latest_height_from_metadata()?
.ok_or(anyhow::anyhow!("on-chain database doesn't have height"))?;
if let Some(on_chain_height) = self.on_chain().latest_height_from_metadata()? {
self.rollback_to(on_chain_height, shutdown_listener)?;
};

self.rollback_to(on_chain_height, shutdown_listener)
Ok(())
}
}

Expand Down

0 comments on commit e5f5d92

Please sign in to comment.