Skip to content

Commit

Permalink
fix traversal error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangchiqing committed Apr 12, 2024
1 parent 015156b commit 8a8a54f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion state/fork/traversal.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,11 @@ func unsafeTraverse(headers storage.Headers, block *flow.Header, visitor onVisit
return block, nil
}

block, err = headers.ByBlockID(block.ParentID)
parent, err := headers.ByBlockID(block.ParentID)
if err != nil {
return nil, fmt.Errorf("failed to revtrieve block header %x: %w", block.ParentID, err)
}

block = parent
}
}

0 comments on commit 8a8a54f

Please sign in to comment.