@@ -9,6 +9,8 @@ use chainhook_types::{
9
9
OrdinalOperation , TransactionIdentifier ,
10
10
} ;
11
11
use hiro_system_kit:: slog;
12
+ use rand:: seq:: SliceRandom ;
13
+ use rand:: thread_rng;
12
14
use rocksdb:: DB ;
13
15
use rusqlite:: Connection ;
14
16
use std:: collections:: { BTreeMap , HashMap , VecDeque } ;
@@ -148,19 +150,20 @@ pub fn update_hord_db_and_augment_bitcoin_block(
148
150
let moved_traversal_tx = traversal_tx. clone ( ) ;
149
151
let moved_ctx = ctx. clone ( ) ;
150
152
let block_identifier = new_block. block_identifier . clone ( ) ;
151
- let blocks_db = open_readonly_hord_db_conn_rocks_db ( hord_db_path, & ctx ) ? ;
153
+ let moved_hord_db_path = hord_db_path. clone ( ) ;
152
154
traversal_data_pool. execute ( move || {
153
- let traversal = retrieve_satoshi_point_using_local_storage (
154
- & blocks_db,
155
- & block_identifier,
156
- & transaction_id,
157
- 0 ,
158
- & moved_ctx,
159
- ) ;
160
- let _ = moved_traversal_tx. send ( ( transaction_id, traversal) ) ;
155
+ if let Ok ( blocks_db) = open_readonly_hord_db_conn_rocks_db ( & moved_hord_db_path, & moved_ctx) {
156
+ let traversal = retrieve_satoshi_point_using_local_storage (
157
+ & blocks_db,
158
+ & block_identifier,
159
+ & transaction_id,
160
+ 0 ,
161
+ & moved_ctx,
162
+ ) ;
163
+ let _ = moved_traversal_tx. send ( ( transaction_id, traversal) ) ;
164
+ }
161
165
} ) ;
162
166
}
163
- let _ = traversal_data_pool. join ( ) ;
164
167
165
168
let mut traversals_received = 0 ;
166
169
while let Ok ( ( transaction_identifier, traversal_result) ) = traversal_rx. recv ( ) {
@@ -171,6 +174,7 @@ pub fn update_hord_db_and_augment_bitcoin_block(
171
174
break ;
172
175
}
173
176
}
177
+ let _ = traversal_data_pool. join ( ) ;
174
178
}
175
179
176
180
let mut storage = Storage :: Sqlite ( inscriptions_db_conn_rw) ;
0 commit comments