Skip to content

Commit

Permalink
chore: tweak how often status is updated for scan loop
Browse files Browse the repository at this point in the history
  • Loading branch information
MicaiahReid committed Jun 18, 2024
1 parent e7a4db7 commit a58f9ee
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion components/chainhook-cli/src/scan/bitcoin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ pub async fn scan_bitcoin_chainstate_via_rpc_using_predicate(
let mut loop_did_trigger = false;
while let Some(current_block_height) = block_heights_to_scan.pop_front() {
if let Some(ref mut predicates_db_conn) = predicates_db_conn {
if number_of_blocks_scanned % 10 == 0
if number_of_blocks_scanned % 100 == 0
|| number_of_blocks_scanned == 0
// if the last loop did trigger a predicate, update the status
|| loop_did_trigger
Expand Down
2 changes: 1 addition & 1 deletion components/chainhook-cli/src/scan/stacks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ pub async fn scan_stacks_chainstate_via_rocksdb_using_predicate(
let mut loop_did_trigger = false;
while let Some(current_block_height) = block_heights_to_scan.pop_front() {
if let Some(ref mut predicates_db_conn) = predicates_db_conn {
if number_of_blocks_scanned % 10 == 0
if number_of_blocks_scanned % 1000 == 0
|| number_of_blocks_scanned == 0
// if the last loop did trigger a predicate, update the status
|| loop_did_trigger
Expand Down

0 comments on commit a58f9ee

Please sign in to comment.