zcash_client_backend: Fix `scan_cached_blocks` panic with genesis block

If `from_height = 0` and `limit > 1`, then the conditional being used to
initialise `continuity_check_metadata` was previously running for every
block, and would therefore panic while processing the block at height 1.
This commit is contained in:
Jack Grigg 2023-08-09 17:35:42 +00:00
parent 44abd3450b
commit d3fc9670d5
1 changed files with 1 additions and 1 deletions

View File

@ -302,7 +302,7 @@ where
return Err(Error::Scan(scan_error));
}
if from_height == BlockHeight::from(0) {
if block.height() == BlockHeight::from(0) {
// We can always derive a valid `continuity_check_metadata` for the
// genesis block, even if the block source doesn't have
// `sapling_commitment_tree_size`. So briefly set it to a dummy value that