@@ -44,12 +44,13 @@ pub fn retrieve_inscribed_satoshi_points_from_block_v3(
44
44
next_blocks : & Vec < BitcoinBlockData > ,
45
45
cache_l1 : & mut HashMap < ( TransactionIdentifier , usize ) , TraversalResult > ,
46
46
cache_l2 : & Arc < DashMap < ( u32 , [ u8 ; 8 ] ) , LazyBlockTransaction , BuildHasherDefault < FxHasher > > > ,
47
+ existing_inscriptions : & mut HashMap < ( TransactionIdentifier , usize ) , TraversalResult > ,
47
48
inscriptions_db_conn : & mut Connection ,
48
49
hord_config : & HordConfig ,
49
50
ctx : & Context ,
50
51
) -> Result < bool , String > {
51
52
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) ;
53
54
54
55
let inner_ctx = if hord_config. logs . ordinals_computation {
55
56
ctx. clone ( )
@@ -190,6 +191,7 @@ pub fn retrieve_inscribed_satoshi_points_from_block_v3(
190
191
let ( mut transactions_ids, _) = get_transactions_to_process (
191
192
next_block,
192
193
cache_l1,
194
+ existing_inscriptions,
193
195
inscriptions_db_conn,
194
196
ctx,
195
197
) ;
@@ -260,6 +262,7 @@ pub fn retrieve_inscribed_satoshi_points_from_block_v3(
260
262
fn get_transactions_to_process (
261
263
block : & BitcoinBlockData ,
262
264
cache_l1 : & mut HashMap < ( TransactionIdentifier , usize ) , TraversalResult > ,
265
+ existing_inscriptions : & mut HashMap < ( TransactionIdentifier , usize ) , TraversalResult > ,
263
266
inscriptions_db_conn : & mut Connection ,
264
267
ctx : & Context ,
265
268
) -> (
@@ -292,8 +295,7 @@ fn get_transactions_to_process(
292
295
}
293
296
294
297
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) ;
297
299
continue ;
298
300
}
299
301
@@ -317,11 +319,15 @@ pub fn update_hord_db_and_augment_bitcoin_block_v3(
317
319
hord_config : & HordConfig ,
318
320
ctx : & Context ,
319
321
) -> Result < ( ) , String > {
322
+
323
+ let mut existing_inscriptions = HashMap :: new ( ) ;
324
+
320
325
let transactions_processed = retrieve_inscribed_satoshi_points_from_block_v3 (
321
326
& new_block,
322
327
& next_blocks,
323
328
cache_l1,
324
329
cache_l2,
330
+ & mut existing_inscriptions,
325
331
inscriptions_db_conn_rw,
326
332
& hord_config,
327
333
ctx,
0 commit comments