diff --git a/zebra-scan/src/storage.rs b/zebra-scan/src/storage.rs index 02e3d09e92a..5737e1254f5 100644 --- a/zebra-scan/src/storage.rs +++ b/zebra-scan/src/storage.rs @@ -19,7 +19,7 @@ pub use db::{SaplingScannedResult, SaplingScanningKey}; use self::db::ScannerWriteBatch; -/// We insert an empty results entry to the database every 1000 blocks for each stored key, +/// We insert an empty results entry to the database every this interval for each stored key, /// so we can track progress. const INSERT_CONTROL_INTERVAL: u32 = 1_000; @@ -123,8 +123,8 @@ impl Storage { // in a single batch. let mut batch = ScannerWriteBatch::default(); - // Every `INSERT_CONTROL_INTERVAL` we add a new control result to the scanner database so we can track progress - // made in the last interval even if no result was found. + // Every `INSERT_CONTROL_INTERVAL` we add a new entry to the scanner database for each key + // so we can track progress made in the last interval even if no transaction was yet found. let is_control_time = height.0 % INSERT_CONTROL_INTERVAL == 0 && sapling_results.is_empty(); for (index, sapling_result) in sapling_results { @@ -141,6 +141,7 @@ impl Storage { batch.insert_sapling_result(self, entry); } + // Add tracking entry for key. if is_control_time { batch.insert_sapling_height(self, &sapling_key, height); } diff --git a/zebra-scan/src/storage/db/sapling.rs b/zebra-scan/src/storage/db/sapling.rs index 21d95b1d3b6..c5ffbd35845 100644 --- a/zebra-scan/src/storage/db/sapling.rs +++ b/zebra-scan/src/storage/db/sapling.rs @@ -172,8 +172,8 @@ impl Storage { let height_results = self.sapling_results_for_key_and_height(&sapling_key, height); // If there are no results for this block, then it's a "skip up to height" marker, and - // the birthday height is the next height. If there are some results, it's the actual - // birthday height. + // the target height is the next height. If there are some results, it's the actual + // target height. if height_results.values().all(Option::is_none) { height = height .next()