diff --git a/zebra-state/src/service/finalized_state/zebra_db/chain.rs b/zebra-state/src/service/finalized_state/zebra_db/chain.rs index b1d6e818846..7f36c705201 100644 --- a/zebra-state/src/service/finalized_state/zebra_db/chain.rs +++ b/zebra-state/src/service/finalized_state/zebra_db/chain.rs @@ -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() diff --git a/zebra-state/src/service/finalized_state/zebra_db/shielded.rs b/zebra-state/src/service/finalized_state/zebra_db/shielded.rs index 4c1c4b753ab..64f67930fcd 100644 --- a/zebra-state/src/service/finalized_state/zebra_db/shielded.rs +++ b/zebra-state/src/service/finalized_state/zebra_db/shielded.rs @@ -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")