diff --git a/components/chainhook-cli/src/scan/bitcoin.rs b/components/chainhook-cli/src/scan/bitcoin.rs index 63d75224..37d37afb 100644 --- a/components/chainhook-cli/src/scan/bitcoin.rs +++ b/components/chainhook-cli/src/scan/bitcoin.rs @@ -102,6 +102,12 @@ pub async fn scan_bitcoin_chainstate_via_rpc_using_predicate( cursor += 1; blocks_scanned += 1; + if let Some(ref inscriptions_db_conn) = inscriptions_db_conn { + if !get_any_entry_in_ordinal_activities(&cursor, &inscriptions_db_conn, &ctx) { + continue; + } + } + let block_hash = retrieve_block_hash_with_retry(&cursor, &bitcoin_config, ctx).await?; let block_breakdown = download_and_parse_block_with_retry(&block_hash, &bitcoin_config, ctx).await?; @@ -121,10 +127,6 @@ pub async fn scan_bitcoin_chainstate_via_rpc_using_predicate( }; if let Some(ref inscriptions_db_conn) = inscriptions_db_conn { - if !get_any_entry_in_ordinal_activities(&cursor, &inscriptions_db_conn, &ctx) { - continue; - } - // Evaluating every single block is required for also keeping track of transfers. let local_traverals = match find_all_inscriptions_in_block(&cursor, &inscriptions_db_conn, &ctx)