Skip to content

Commit

Permalink
eth/catalyst: fix header retrieval, fix sign check
Browse files Browse the repository at this point in the history
  • Loading branch information
karalabe committed Jul 28, 2022
1 parent d7f62f8 commit f82041b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions eth/catalyst/api.go
Expand Up @@ -479,12 +479,11 @@ func (api *ConsensusAPI) checkInvalidAncestor(check common.Hash, head common.Has
}
api.invalidTipsets[head] = invalid
}
// if the last valid hash is the terminal pow block, return 0x0 for latest valid hash
// If the last valid hash is the terminal pow block, return 0x0 for latest valid hash
lastValid := &invalid.ParentHash
if header := api.eth.BlockChain().GetHeaderByHash(invalid.ParentHash); header != nil && header.Difficulty.BitLen() == 0 {
if header := api.eth.BlockChain().GetHeader(invalid.ParentHash, invalid.Number.Uint64()-1); header != nil && header.Difficulty.Sign() != 0 {
lastValid = &common.Hash{}
}

failure := "links to previously rejected block"
return &beacon.PayloadStatusV1{
Status: beacon.INVALID,
Expand Down

0 comments on commit f82041b

Please sign in to comment.