mirror of
https://github.com/alexgo-io/bitcoin-indexer.git
synced 2026-01-12 16:52:57 +08:00
feat: optimize replay
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user