Avoids panic in test

This commit is contained in:
Arya 2024-04-23 19:58:33 -04:00
parent 479b0b272e
commit b3db5b03e5
1 changed files with 9 additions and 3 deletions

View File

@ -455,9 +455,15 @@ impl HistoryTree {
sapling_root: &sapling::tree::Root,
orchard_root: &orchard::tree::Root,
) -> Result<(), HistoryTreeError> {
let heartwood_height = NetworkUpgrade::Heartwood
.activation_height(network)
.expect("Heartwood height is known");
let Some(heartwood_height) = NetworkUpgrade::Heartwood.activation_height(network) else {
assert!(
self.0.is_none(),
"history tree must not exist pre-Heartwood"
);
return Ok(());
};
match block
.coinbase_height()
.expect("must have height")