mirror of
https://github.com/alexgo-io/bitcoin-indexer.git
synced 2026-06-14 00:22:19 +08:00
fix: build errors
This commit is contained in:
@@ -1083,4 +1083,5 @@ pub async fn fetch_and_standardize_block(
|
||||
download_and_parse_block_with_retry(&block_hash, &bitcoin_config, &ctx).await?;
|
||||
|
||||
indexer::bitcoin::standardize_bitcoin_block(block_breakdown, &bitcoin_config.network, &ctx)
|
||||
.map_err(|(e, _)| e)
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ pub async fn scan_bitcoin_chainstate_via_rpc_using_predicate(
|
||||
ctx,
|
||||
) {
|
||||
Ok(data) => data,
|
||||
Err(e) => {
|
||||
Err((e, _)) => {
|
||||
warn!(
|
||||
ctx.expect_logger(),
|
||||
"Unable to standardize block#{} {}: {}", cursor, block_hash, e
|
||||
|
||||
@@ -492,12 +492,26 @@ pub fn find_inscription_with_id(
|
||||
inscription_id: &str,
|
||||
block_hash: &str,
|
||||
inscriptions_db_conn: &Connection,
|
||||
_ctx: &Context,
|
||||
ctx: &Context,
|
||||
) -> Option<TraversalResult> {
|
||||
let args: &[&dyn ToSql] = &[&inscription_id.to_sql().unwrap()];
|
||||
let mut stmt = inscriptions_db_conn
|
||||
let mut stmt = loop {
|
||||
match inscriptions_db_conn
|
||||
.prepare("SELECT inscription_number, ordinal_number, block_hash, offset, outpoint_to_watch FROM inscriptions WHERE inscription_id = ?")
|
||||
.unwrap();
|
||||
{
|
||||
Ok(stmt) => break stmt,
|
||||
Err(e) => {
|
||||
ctx.try_log(|logger| {
|
||||
slog::warn!(
|
||||
logger,
|
||||
"unable to retrieve inscription with id: {}",
|
||||
e.to_string(),
|
||||
)
|
||||
});
|
||||
std::thread::sleep(std::time::Duration::from_secs(5));
|
||||
}
|
||||
}
|
||||
};
|
||||
let mut rows = stmt.query(args).unwrap();
|
||||
while let Ok(Some(row)) = rows.next() {
|
||||
let inscription_block_hash: String = row.get(2).unwrap();
|
||||
@@ -828,7 +842,7 @@ pub async fn fetch_and_cache_blocks_in_hord_db(
|
||||
let mut new_block =
|
||||
match standardize_bitcoin_block(next_block, &bitcoin_network, &ctx) {
|
||||
Ok(block) => block,
|
||||
Err(e) => {
|
||||
Err((e, _)) => {
|
||||
ctx.try_log(|logger| {
|
||||
slog::error!(logger, "Unable to standardize bitcoin block: {e}",)
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user