Skip to content

Commit

Permalink
Discard keys provided by low level database method
Browse files Browse the repository at this point in the history
  • Loading branch information
teor2345 authored Nov 21, 2023
1 parent f7a43b7 commit dbd41b7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion zebra-state/src/service/finalized_state/zebra_db/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ impl ZebraDb {
// In Zebra 1.4.0 and later, we only update the history tip tree when it has changed (for every block after heartwood).
// But we write with a `()` key, not a height key.
// So we need to look for the most recent update height if the `()` key has never been written.
history_tree = self.db.zs_last_key_value(&history_tree_cf);
history_tree = self.db.zs_last_key_value(&history_tree_cf).map(|(_height_key, tree_value)| tree_value);
}

history_tree.unwrap_or_default()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ impl ZebraDb {
// In Zebra 1.4.0 and later, we don't update the sprout tip tree unless it is changed.
// And we write with a `()` key, not a height key.
// So we need to look for the most recent update height if the `()` key has never been written.
sprout_tree = self.db.zs_last_key_value(&sprout_tree_cf);
sprout_tree = self.db.zs_last_key_value(&sprout_tree_cf).map(|(_height_key, tree_value)| tree_value);;
}

sprout_tree.expect("Sprout note commitment tree must exist if there is a finalized tip")
Expand Down

0 comments on commit dbd41b7

Please sign in to comment.