Skip to content

Commit 06883c6

Browse files
author
Ludo Galabru
committed
fix: pipeline resuming
1 parent 9d52f5c commit 06883c6

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

components/hord-cli/src/core/protocol/sequencing.rs

+9-3
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,13 @@ pub fn retrieve_inscribed_satoshi_points_from_block_v3(
4444
next_blocks: &Vec<BitcoinBlockData>,
4545
cache_l1: &mut HashMap<(TransactionIdentifier, usize), TraversalResult>,
4646
cache_l2: &Arc<DashMap<(u32, [u8; 8]), LazyBlockTransaction, BuildHasherDefault<FxHasher>>>,
47+
existing_inscriptions: &mut HashMap<(TransactionIdentifier, usize), TraversalResult>,
4748
inscriptions_db_conn: &mut Connection,
4849
hord_config: &HordConfig,
4950
ctx: &Context,
5051
) -> Result<bool, String> {
5152
let (mut transactions_ids, l1_cache_hits) =
52-
get_transactions_to_process(block, cache_l1, inscriptions_db_conn, ctx);
53+
get_transactions_to_process(block, cache_l1, existing_inscriptions, inscriptions_db_conn, ctx);
5354

5455
let inner_ctx = if hord_config.logs.ordinals_computation {
5556
ctx.clone()
@@ -190,6 +191,7 @@ pub fn retrieve_inscribed_satoshi_points_from_block_v3(
190191
let (mut transactions_ids, _) = get_transactions_to_process(
191192
next_block,
192193
cache_l1,
194+
existing_inscriptions,
193195
inscriptions_db_conn,
194196
ctx,
195197
);
@@ -260,6 +262,7 @@ pub fn retrieve_inscribed_satoshi_points_from_block_v3(
260262
fn get_transactions_to_process(
261263
block: &BitcoinBlockData,
262264
cache_l1: &mut HashMap<(TransactionIdentifier, usize), TraversalResult>,
265+
existing_inscriptions: &mut HashMap<(TransactionIdentifier, usize), TraversalResult>,
263266
inscriptions_db_conn: &mut Connection,
264267
ctx: &Context,
265268
) -> (
@@ -292,8 +295,7 @@ fn get_transactions_to_process(
292295
}
293296

294297
if let Some(entry) = known_transactions.remove(&key) {
295-
l1_cache_hits.push(key.clone());
296-
cache_l1.insert(key, entry);
298+
existing_inscriptions.insert(key, entry);
297299
continue;
298300
}
299301

@@ -317,11 +319,15 @@ pub fn update_hord_db_and_augment_bitcoin_block_v3(
317319
hord_config: &HordConfig,
318320
ctx: &Context,
319321
) -> Result<(), String> {
322+
323+
let mut existing_inscriptions = HashMap::new();
324+
320325
let transactions_processed = retrieve_inscribed_satoshi_points_from_block_v3(
321326
&new_block,
322327
&next_blocks,
323328
cache_l1,
324329
cache_l2,
330+
&mut existing_inscriptions,
325331
inscriptions_db_conn_rw,
326332
&hord_config,
327333
ctx,

0 commit comments

Comments
 (0)