Skip to content

Commit 888c6f4

Browse files
committed
add genesis check
1 parent 8d1f3b8 commit 888c6f4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

epoch.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1558,7 +1558,6 @@ func (e *Epoch) handleBlockMessage(message *BlockMessage, from NodeID) error {
15581558

15591559
// Create a task that will verify the block in the future, after its predecessors have also been verified.
15601560
task := e.createBlockVerificationTask(e.oneTimeVerifier.Wrap(block), from, vote)
1561-
15621561
prevBlockDependency, emptyNotarizationDependency := e.blockDependencies(md)
15631562

15641563
// Schedule the block to be verified once its direct predecessor have been verified,
@@ -1579,6 +1578,11 @@ func (e *Epoch) handleBlockMessage(message *BlockMessage, from NodeID) error {
15791578
// as well as a list of rounds for which it needs to verify empty notarizations.
15801579
// TODO: we should request empty notarizations if we don't have them
15811580
func (e *Epoch) blockDependencies(bh BlockHeader) (Digest, []uint64) {
1581+
if bh.Seq == 0 {
1582+
// genesis block has no dependencies
1583+
return emptyDigest, nil
1584+
}
1585+
15821586
prevBlockDependency := bh.Prev
15831587

15841588
prevBlock, notarizationOrFinalization, found := e.locateBlock(bh.Seq-1, bh.Prev[:])

0 commit comments

Comments
 (0)