Skip to content

Commit

Permalink
fix(core): Use Verify from go-header pkg in CoreExchange (#3077)
Browse files Browse the repository at this point in the history
We should have been using the high-level `Verify` check from go-header
inside of the `CoreExchange` instead of the `ExtendedHeader`-based
implementation of Verify.

Co-authored-by: ramin <[email protected]>
  • Loading branch information
renaynay and ramin authored Jan 9, 2024
1 parent f8f4af7 commit 73336ed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/exchange.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func (ce *Exchange) GetRangeByHeight(
ce.metrics.requestDurationPerHeader(ctx, time.Since(start), amount)

for _, h := range headers {
err := from.Verify(h)
err := libhead.Verify[*header.ExtendedHeader](from, h, libhead.DefaultHeightThreshold)
if err != nil {
return nil, fmt.Errorf("verifying next header against last verified height: %d: %w",
from.Height(), err)
Expand Down

0 comments on commit 73336ed

Please sign in to comment.