Skip to content

Commit b294dff

Browse files
author
Ludo Galabru
committed
feat: number of retries for 4 to 3
1 parent f472a49 commit b294dff

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -859,7 +859,7 @@ async fn handle_command(opts: Opts, ctx: Context) -> Result<(), String> {
859859

860860
let mut missing_blocks = vec![];
861861
for i in 1..=790000 {
862-
if find_lazy_block_at_block_height(i, 4, &blocks_db_rw, &ctx).is_none() {
862+
if find_lazy_block_at_block_height(i, 3, &blocks_db_rw, &ctx).is_none() {
863863
println!("Missing block {i}");
864864
missing_blocks.push(i);
865865
}
@@ -899,7 +899,7 @@ async fn handle_command(opts: Opts, ctx: Context) -> Result<(), String> {
899899
let config = Config::default(false, false, false, &cmd.config_path)?;
900900
let stacks_db = open_readonly_stacks_db_conn(&config.expected_cache_path(), &ctx)
901901
.expect("unable to read stacks_db");
902-
match get_stacks_block_at_block_height(cmd.block_height, true, 4, &stacks_db) {
902+
match get_stacks_block_at_block_height(cmd.block_height, true, 3, &stacks_db) {
903903
Ok(Some(block)) => {
904904
info!(ctx.expect_logger(), "{}", json!(block));
905905
}

components/chainhook-cli/src/scan/bitcoin.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ pub async fn scan_bitcoin_chainstate_via_rpc_using_predicate(
8080
let blocks_db_rw =
8181
open_readwrite_hord_db_conn_rocks_db(&config.expected_cache_path(), ctx)?;
8282

83-
if find_lazy_block_at_block_height(end_block as u32, 4, &blocks_db_rw, &ctx).is_none() {
83+
if find_lazy_block_at_block_height(end_block as u32, 3, &blocks_db_rw, &ctx).is_none() {
8484
// Count how many entries in the table
8585
// Compute the right interval
8686
// Start the build local storage routine

components/chainhook-sdk/src/hord/db/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -981,7 +981,7 @@ pub fn retrieve_satoshi_point_using_lazy_storage(
981981
tx.get_cumulated_sats_in_until_input_index(input_index),
982982
)
983983
}
984-
None => match find_lazy_block_at_block_height(ordinal_block_number, 4, &blocks_db, &ctx) {
984+
None => match find_lazy_block_at_block_height(ordinal_block_number, 3, &blocks_db, &ctx) {
985985
None => {
986986
return Err(format!("block #{ordinal_block_number} not in database"));
987987
}
@@ -1080,7 +1080,7 @@ pub fn retrieve_satoshi_point_using_lazy_storage(
10801080
}
10811081

10821082
let lazy_block =
1083-
match find_lazy_block_at_block_height(ordinal_block_number, 4, &blocks_db, &ctx) {
1083+
match find_lazy_block_at_block_height(ordinal_block_number, 3, &blocks_db, &ctx) {
10841084
Some(block) => block,
10851085
None => {
10861086
return Err(format!("block #{ordinal_block_number} not in database"));

0 commit comments

Comments
 (0)