Skip to content

Commit 607ac95

Browse files
author
Ludo Galabru
committed
fix: build
1 parent 1ccbc30 commit 607ac95

File tree

3 files changed

+18
-13
lines changed

3 files changed

+18
-13
lines changed

components/chainhook-cli/src/cli/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -590,8 +590,8 @@ async fn handle_command(opts: Opts, ctx: Context) -> Result<(), String> {
590590
index: cmd.block_height,
591591
hash: "".into(),
592592
};
593-
594-
let traversal = retrieve_satoshi_point_using_local_storage(
593+
// let global_block_cache = HashMap::new();
594+
let (traversal, _) = retrieve_satoshi_point_using_local_storage(
595595
&hord_db_conn,
596596
&block_identifier,
597597
&transaction_identifier,

components/chainhook-event-observer/src/hord/db/mod.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ use std::{
44
};
55

66
use chainhook_types::{
7-
BitcoinBlockData, BlockIdentifier, OrdinalInscriptionRevealData, TransactionIdentifier,
7+
BitcoinBlockData, BlockIdentifier, OrdinalInscriptionRevealData, StacksBlockData,
8+
TransactionIdentifier,
89
};
910
use hiro_system_kit::slog;
1011

components/chainhook-event-observer/src/hord/mod.rs

+14-10
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ use chainhook_types::{
99
OrdinalOperation, TransactionIdentifier,
1010
};
1111
use hiro_system_kit::slog;
12+
use rand::seq::SliceRandom;
13+
use rand::thread_rng;
1214
use rocksdb::DB;
1315
use rusqlite::Connection;
1416
use std::collections::{BTreeMap, HashMap, VecDeque};
@@ -148,19 +150,20 @@ pub fn update_hord_db_and_augment_bitcoin_block(
148150
let moved_traversal_tx = traversal_tx.clone();
149151
let moved_ctx = ctx.clone();
150152
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();
152154
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+
}
161165
});
162166
}
163-
let _ = traversal_data_pool.join();
164167

165168
let mut traversals_received = 0;
166169
while let Ok((transaction_identifier, traversal_result)) = traversal_rx.recv() {
@@ -171,6 +174,7 @@ pub fn update_hord_db_and_augment_bitcoin_block(
171174
break;
172175
}
173176
}
177+
let _ = traversal_data_pool.join();
174178
}
175179

176180
let mut storage = Storage::Sqlite(inscriptions_db_conn_rw);

0 commit comments

Comments
 (0)