Skip to content

Commit

Permalink
Add header index to error message thrown by `validateBitcoinHeadersCh…
Browse files Browse the repository at this point in the history
…ain`
  • Loading branch information
lukasz-zimnoch committed Oct 16, 2023
1 parent e063022 commit 62ac608
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion typescript/src/lib/bitcoin/header.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,9 @@ export function validateBitcoinHeadersChain(
if (
!previousBlockHeaderHash.equals(currentHeader.previousBlockHeaderHash)
) {
throw new Error("Invalid headers chain")
throw new Error(
`Invalid headers chain; problem with header index: ${index}`
)
}
}

Expand Down

0 comments on commit 62ac608

Please sign in to comment.