Skip to content

Commit

Permalink
consensus/parlia: fix verification for ParentBeaconRoot
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanBSC committed Jul 30, 2024
1 parent 00cac12 commit d2f4dcc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion consensus/parlia/parlia.go
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,9 @@ func (p *Parlia) verifyHeader(chain consensus.ChainHeaderReader, header *types.H
return fmt.Errorf("invalid parentBeaconRoot, have %#x, expected nil", header.ParentBeaconRoot)
}
} else {
if header.ParentBeaconRoot == nil || *header.ParentBeaconRoot != (common.Hash{}) {
if header.ParentBeaconRoot == nil {
return fmt.Errorf("invalid parentBeaconRoot, have nil, expected zero hash")
} else if *header.ParentBeaconRoot != (common.Hash{}) {
return fmt.Errorf("invalid parentBeaconRoot, have %#x, expected zero hash", header.ParentBeaconRoot)
}
}
Expand Down

0 comments on commit d2f4dcc

Please sign in to comment.