Skip to content

Commit

Permalink
Merge pull request zingolabs#504 from AloeareV/fix_initiation_below_o…
Browse files Browse the repository at this point in the history
…rchard_activation

Don't unwrap a tree that might not be there
  • Loading branch information
fluidvanadium authored Sep 26, 2023
2 parents 324d39b + 83819f5 commit ef38b78
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions zingolib/src/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,17 +253,15 @@ impl LightWallet {
&[u8],
COMMITMENT_TREE_LEVELS,
>(&hex::decode(trees.sapling_tree).unwrap()[..])
.unwrap()
.to_frontier()
.take(),
.ok()
.and_then(|tree| tree.to_frontier().take()),
zcash_primitives::merkle_tree::read_commitment_tree::<
MerkleHashOrchard,
&[u8],
COMMITMENT_TREE_LEVELS,
>(&hex::decode(trees.orchard_tree).unwrap()[..])
.unwrap()
.to_frontier()
.take(),
.ok()
.and_then(|tree| tree.to_frontier().take()),
)
}
pub(crate) async fn initiate_witness_trees(&self, trees: crate::compact_formats::TreeState) {
Expand Down

0 comments on commit ef38b78

Please sign in to comment.