Skip to content

Commit

Permalink
Merge pull request zingolabs#543 from Oscar-Pepper/dont_unwrap_maybe_…
Browse files Browse the repository at this point in the history
…missing_trees

Dont unwrap maybe missing trees
  • Loading branch information
zancas authored Sep 29, 2023
2 parents a485db6 + 446820d commit 42557f4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions zingolib/src/blaze/block_witness_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,10 @@ impl BlockAndWitnessData {
let mut orchard_tree = read_commitment_tree(
&hex::decode(closest_lower_verified_tree.orchard_tree).unwrap()[..],
)
.or_else(|error| match dbg!(error.kind()) {
std::io::ErrorKind::UnexpectedEof => Ok(CommitmentTree::empty()),
_ => Err(error),
})
.expect("Invalid orchard tree!");

{
Expand Down

0 comments on commit 42557f4

Please sign in to comment.