Skip to content

Commit

Permalink
Update zcash_client_sqlite/src/wallet.rs
Browse files Browse the repository at this point in the history
Co-authored-by: Daira Hopwood <[email protected]>
  • Loading branch information
str4d and daira authored Jul 12, 2023
1 parent 685ae2b commit 9d337dd
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions zcash_client_sqlite/src/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -817,20 +817,20 @@ pub(crate) fn truncate_to_height<P: consensus::Parameters>(
[u32::from(block_height)],
)?;

// Delete from the scanning queue any range with a start height greater than or equal to
// the truncation height, and truncate any remaining range by setting the end equal to
// the truncation height.
// Delete from the scanning queue any range with a start height greater than
// the truncation height, and then truncate any remaining range by setting the
// end equal to the truncation height + 1.
conn.execute(
"DELETE FROM scan_queue
WHERE block_range_start >= :block_height",
WHERE block_range_start > :block_height",
named_params![":block_height": u32::from(block_height)],
)?;

conn.execute(
"UPDATE scan_queue
SET block_range_end = :block_height
WHERE block_range_end > :block_height",
named_params![":block_height": u32::from(block_height)],
SET block_range_end = :end_height
WHERE block_range_end > :end_height",
named_params![":end_height": u32::from(block_height + 1)],
)?;

// Prioritize the range starting at the height we just rewound to for verification
Expand Down

0 comments on commit 9d337dd

Please sign in to comment.