Skip to content

Commit

Permalink
Fix comment in zcash_client_backend::scanning
Browse files Browse the repository at this point in the history
Co-authored-by: Daira Emma Hopwood <[email protected]>
  • Loading branch information
nuttycom and daira authored Nov 9, 2023
1 parent b9ac7c5 commit 196bb59
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions zcash_client_backend/src/scanning.rs
Original file line number Diff line number Diff line change
Expand Up @@ -378,12 +378,12 @@ pub(crate) fn scan_block_with_runner<
.try_into()
.expect("Sapling output count cannot exceed a u32");

// The default for m.sapling_commitment_tree_size is zero, so we need to check
// that the subtraction will not underflow; if it would do so, we given invalid
// chain metadata for a block with Sapling outputs.
if m.sapling_commitment_tree_size >= sapling_output_count {
Ok(m.sapling_commitment_tree_size - sapling_output_count)
} else {
// The default for m.sapling_commitment_tree_size is zero, so we need to check
// that the subtraction will not underflow; if it would do so, we given invalid
// chain metadata for a block with Sapling outputs.
Err(ScanError::TreeSizeInvalid {
protocol: ShieldedProtocol::Sapling,
at_height: cur_height,
Expand Down

0 comments on commit 196bb59

Please sign in to comment.