mirror of
https://github.com/alexgo-io/bitcoin-indexer.git
synced 2026-01-12 08:34:17 +08:00
feat: number of retries for 4 to 3
This commit is contained in:
@@ -859,7 +859,7 @@ async fn handle_command(opts: Opts, ctx: Context) -> Result<(), String> {
|
||||
|
||||
let mut missing_blocks = vec![];
|
||||
for i in 1..=790000 {
|
||||
if find_lazy_block_at_block_height(i, 4, &blocks_db_rw, &ctx).is_none() {
|
||||
if find_lazy_block_at_block_height(i, 3, &blocks_db_rw, &ctx).is_none() {
|
||||
println!("Missing block {i}");
|
||||
missing_blocks.push(i);
|
||||
}
|
||||
@@ -899,7 +899,7 @@ async fn handle_command(opts: Opts, ctx: Context) -> Result<(), String> {
|
||||
let config = Config::default(false, false, false, &cmd.config_path)?;
|
||||
let stacks_db = open_readonly_stacks_db_conn(&config.expected_cache_path(), &ctx)
|
||||
.expect("unable to read stacks_db");
|
||||
match get_stacks_block_at_block_height(cmd.block_height, true, 4, &stacks_db) {
|
||||
match get_stacks_block_at_block_height(cmd.block_height, true, 3, &stacks_db) {
|
||||
Ok(Some(block)) => {
|
||||
info!(ctx.expect_logger(), "{}", json!(block));
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ pub async fn scan_bitcoin_chainstate_via_rpc_using_predicate(
|
||||
let blocks_db_rw =
|
||||
open_readwrite_hord_db_conn_rocks_db(&config.expected_cache_path(), ctx)?;
|
||||
|
||||
if find_lazy_block_at_block_height(end_block as u32, 4, &blocks_db_rw, &ctx).is_none() {
|
||||
if find_lazy_block_at_block_height(end_block as u32, 3, &blocks_db_rw, &ctx).is_none() {
|
||||
// Count how many entries in the table
|
||||
// Compute the right interval
|
||||
// Start the build local storage routine
|
||||
|
||||
@@ -981,7 +981,7 @@ pub fn retrieve_satoshi_point_using_lazy_storage(
|
||||
tx.get_cumulated_sats_in_until_input_index(input_index),
|
||||
)
|
||||
}
|
||||
None => match find_lazy_block_at_block_height(ordinal_block_number, 4, &blocks_db, &ctx) {
|
||||
None => match find_lazy_block_at_block_height(ordinal_block_number, 3, &blocks_db, &ctx) {
|
||||
None => {
|
||||
return Err(format!("block #{ordinal_block_number} not in database"));
|
||||
}
|
||||
@@ -1080,7 +1080,7 @@ pub fn retrieve_satoshi_point_using_lazy_storage(
|
||||
}
|
||||
|
||||
let lazy_block =
|
||||
match find_lazy_block_at_block_height(ordinal_block_number, 4, &blocks_db, &ctx) {
|
||||
match find_lazy_block_at_block_height(ordinal_block_number, 3, &blocks_db, &ctx) {
|
||||
Some(block) => block,
|
||||
None => {
|
||||
return Err(format!("block #{ordinal_block_number} not in database"));
|
||||
|
||||
Reference in New Issue
Block a user