Skip to content

Commit

Permalink
fix: ensure datastore is consistently updated on new blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
hugocaillard committed Sep 29, 2024
1 parent f5e8db7 commit 799fff8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions components/clarity-repl/src/repl/datastore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -501,12 +501,12 @@ impl Datastore {

clarity_datastore
.block_id_lookup
.insert(id, current_lookup_id)
.expect("failed to insert block id into lookup table");
.entry(id)
.or_insert(current_lookup_id);
clarity_datastore
.height_at_chain_tip
.insert(id, self.stacks_chain_height)
.expect("failed to insert height into chain tip table");
.entry(id)
.or_insert(self.stacks_chain_height);
clarity_datastore.open_chain_tip = height_to_id(self.stacks_chain_height);
clarity_datastore.current_chain_tip = clarity_datastore.open_chain_tip;
}
Expand Down

0 comments on commit 799fff8

Please sign in to comment.