Skip to content

Commit

Permalink
feat: number of retries for 4 to 3
Browse files Browse the repository at this point in the history
  • Loading branch information
lgalabru committed Jun 14, 2023
1 parent f472a49 commit b294dff
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions components/chainhook-cli/src/cli/mod.rs
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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));
}
Expand Down
2 changes: 1 addition & 1 deletion components/chainhook-cli/src/scan/bitcoin.rs
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions components/chainhook-sdk/src/hord/db/mod.rs
Expand Up @@ -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"));
}
Expand Down Expand Up @@ -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"));
Expand Down

0 comments on commit b294dff

Please sign in to comment.