mirror of
https://github.com/alexgo-io/bitcoin-indexer.git
synced 2026-06-13 16:19:01 +08:00
fix: build warnings
This commit is contained in:
@@ -14,16 +14,14 @@ use chainhook_event_observer::chainhooks::types::{
|
||||
};
|
||||
use chainhook_event_observer::hord::db::{
|
||||
delete_blocks_in_block_range_sqlite, delete_data_in_hord_db, fetch_and_cache_blocks_in_hord_db,
|
||||
find_block_at_block_height, find_block_at_block_height_sqlite,
|
||||
find_inscriptions_at_wached_outpoint, find_last_block_inserted,
|
||||
find_block_at_block_height, find_block_at_block_height_sqlite, find_last_block_inserted,
|
||||
find_watched_satpoint_for_inscription, initialize_hord_db, insert_entry_in_blocks,
|
||||
insert_entry_in_blocks_lazy_block, open_readonly_hord_db_conn,
|
||||
open_readonly_hord_db_conn_rocks_db, open_readwrite_hord_db_conn,
|
||||
open_readwrite_hord_db_conn_rocks_db, retrieve_satoshi_point_using_lazy_storage,
|
||||
CompactedBlock, LazyBlock,
|
||||
open_readwrite_hord_db_conn_rocks_db, retrieve_satoshi_point_using_lazy_storage, LazyBlock,
|
||||
};
|
||||
use chainhook_event_observer::hord::{
|
||||
new_traversals_cache, new_traversals_lazy_cache, retrieve_inscribed_satoshi_points_from_block,
|
||||
new_traversals_lazy_cache, retrieve_inscribed_satoshi_points_from_block,
|
||||
update_storage_and_augment_bitcoin_block_with_inscription_transfer_data, Storage,
|
||||
};
|
||||
use chainhook_event_observer::indexer;
|
||||
|
||||
@@ -27,7 +27,7 @@ use crate::{
|
||||
};
|
||||
|
||||
use super::{
|
||||
new_traversals_cache, new_traversals_lazy_cache,
|
||||
new_traversals_lazy_cache,
|
||||
ord::{height::Height, sat::Sat},
|
||||
update_hord_db_and_augment_bitcoin_block,
|
||||
};
|
||||
@@ -570,9 +570,21 @@ pub fn find_lazy_block_at_block_height(
|
||||
retry: u8,
|
||||
blocks_db: &DB,
|
||||
) -> Option<LazyBlock> {
|
||||
match blocks_db.get(block_height.to_be_bytes()) {
|
||||
Ok(Some(res)) => Some(LazyBlock::new(res)),
|
||||
_ => None,
|
||||
let mut attempt = 0;
|
||||
// let mut read_options = rocksdb::ReadOptions::default();
|
||||
// read_options.fill_cache(true);
|
||||
// read_options.set_verify_checksums(false);
|
||||
loop {
|
||||
match blocks_db.get(block_height.to_be_bytes()) {
|
||||
Ok(Some(res)) => return Some(LazyBlock::new(res)),
|
||||
_ => {
|
||||
attempt += 1;
|
||||
std::thread::sleep(std::time::Duration::from_secs(1));
|
||||
if attempt > retry {
|
||||
return None;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ use crate::chainhooks::types::{
|
||||
ChainhookConfig, ChainhookFullSpecification, ChainhookSpecification,
|
||||
};
|
||||
|
||||
use crate::hord::new_traversals_cache;
|
||||
use crate::hord::new_traversals_lazy_cache;
|
||||
#[cfg(feature = "ordinals")]
|
||||
use crate::hord::{
|
||||
db::{open_readwrite_hord_db_conn, open_readwrite_hord_db_conn_rocks_db},
|
||||
@@ -596,7 +596,7 @@ pub async fn start_observer_commands_handler(
|
||||
let mut chainhooks_lookup: HashMap<String, ApiKey> = HashMap::new();
|
||||
let networks = (&config.bitcoin_network, &config.stacks_network);
|
||||
let mut bitcoin_block_store: HashMap<BlockIdentifier, BitcoinBlockData> = HashMap::new();
|
||||
let traversals_cache = Arc::new(new_traversals_cache());
|
||||
let traversals_cache = Arc::new(new_traversals_lazy_cache());
|
||||
|
||||
loop {
|
||||
let command = match observer_commands_rx.recv() {
|
||||
|
||||
Reference in New Issue
Block a user