feat: optimize replay

This commit is contained in:
Ludo Galabru
2023-06-26 19:28:19 -04:00
parent 2857d0a1a4
commit be26daccd0

View File

@@ -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)