Skip to content

Commit

Permalink
fix: off by one
Browse files Browse the repository at this point in the history
  • Loading branch information
Ludo Galabru committed Apr 17, 2023
1 parent 117e41e commit abf70e7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions components/chainhook-event-observer/src/hord/db/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,7 @@ pub async fn fetch_and_cache_blocks_in_hord_db(
.expect("unable to spawn thread");

let mut blocks_stored = 0;
let mut cursor = 1 + start_block as usize;
let mut cursor = start_block as usize;
let mut inbox = HashMap::new();
let mut num_writes = 0;

Expand Down Expand Up @@ -801,7 +801,7 @@ pub async fn fetch_and_cache_blocks_in_hord_db(
&ctx,
) {
ctx.try_log(|logger| {
slog::error!(logger, "Unable to augment bitcoin block with hord_db: {e}",)
slog::error!(logger, "Unable to augment bitcoin block {} with hord_db: {e}", new_block.block_identifier.index)
});
return Err(e);
}
Expand Down
4 changes: 2 additions & 2 deletions components/chainhook-event-observer/src/observer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ pub async fn start_observer_commands_handler(
ctx.try_log(|logger| {
slog::error!(
logger,
"Unable to augment bitcoin block with hord_db: {e}",
"Unable to insert bitcoin block {} in hord_db: {e}", block.block_identifier.index
)
});
}
Expand Down Expand Up @@ -832,7 +832,7 @@ pub async fn start_observer_commands_handler(
ctx.try_log(|logger| {
slog::error!(
logger,
"Unable to augment bitcoin block with hord_db: {e}",
"Unable to apply bitcoin block {} with hord_db: {e}", block.block_identifier.index
)
});
}
Expand Down

0 comments on commit abf70e7

Please sign in to comment.