Skip to content

Commit abf70e7

Browse files
author
Ludo Galabru
committed
fix: off by one
1 parent 117e41e commit abf70e7

File tree

2 files changed

+4
-4
lines changed
  • components/chainhook-event-observer/src

2 files changed

+4
-4
lines changed

components/chainhook-event-observer/src/hord/db/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -762,7 +762,7 @@ pub async fn fetch_and_cache_blocks_in_hord_db(
762762
.expect("unable to spawn thread");
763763

764764
let mut blocks_stored = 0;
765-
let mut cursor = 1 + start_block as usize;
765+
let mut cursor = start_block as usize;
766766
let mut inbox = HashMap::new();
767767
let mut num_writes = 0;
768768

@@ -801,7 +801,7 @@ pub async fn fetch_and_cache_blocks_in_hord_db(
801801
&ctx,
802802
) {
803803
ctx.try_log(|logger| {
804-
slog::error!(logger, "Unable to augment bitcoin block with hord_db: {e}",)
804+
slog::error!(logger, "Unable to augment bitcoin block {} with hord_db: {e}", new_block.block_identifier.index)
805805
});
806806
return Err(e);
807807
}

components/chainhook-event-observer/src/observer/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -699,7 +699,7 @@ pub async fn start_observer_commands_handler(
699699
ctx.try_log(|logger| {
700700
slog::error!(
701701
logger,
702-
"Unable to augment bitcoin block with hord_db: {e}",
702+
"Unable to insert bitcoin block {} in hord_db: {e}", block.block_identifier.index
703703
)
704704
});
705705
}
@@ -832,7 +832,7 @@ pub async fn start_observer_commands_handler(
832832
ctx.try_log(|logger| {
833833
slog::error!(
834834
logger,
835-
"Unable to augment bitcoin block with hord_db: {e}",
835+
"Unable to apply bitcoin block {} with hord_db: {e}", block.block_identifier.index
836836
)
837837
});
838838
}

0 commit comments

Comments
 (0)