@@ -1577,13 +1577,13 @@ func (e *Epoch) handleBlockMessage(message *BlockMessage, from NodeID) error {
15771577// It returns the digest of the previous block it depends on (or emptyDigest if none),
15781578// as well as a list of rounds for which it needs to verify empty notarizations.
15791579// TODO: we should request empty notarizations if we don't have them
1580- func (e * Epoch ) blockDependencies (bh BlockHeader ) (Digest , []uint64 ) {
1580+ func (e * Epoch ) blockDependencies (bh BlockHeader ) (* Digest , []uint64 ) {
15811581 if bh .Seq == 0 {
15821582 // genesis block has no dependencies
1583- return emptyDigest , nil
1583+ return nil , nil
15841584 }
15851585
1586- prevBlockDependency := bh .Prev
1586+ prevBlockDependency := & bh .Prev
15871587
15881588 prevBlock , notarizationOrFinalization , found := e .locateBlock (bh .Seq - 1 , bh .Prev [:])
15891589 if ! found {
@@ -1592,12 +1592,12 @@ func (e *Epoch) blockDependencies(bh BlockHeader) (Digest, []uint64) {
15921592 zap .Uint64 ("seq" , bh .Seq - 1 ),
15931593 zap .Stringer ("prev" , bh .Prev ))
15941594
1595- return emptyDigest , nil
1595+ return nil , nil
15961596 }
15971597
15981598 // no block dependency if we already have a notarization or finalization for the previous block
15991599 if notarizationOrFinalization != nil {
1600- prevBlockDependency = emptyDigest
1600+ prevBlockDependency = nil
16011601 }
16021602
16031603 // missing empty rounds
@@ -1928,10 +1928,10 @@ func (e *Epoch) createNotarizedBlockVerificationTask(block Block, notarization N
19281928
19291929// finalizedBlockDependency returns the dependency digest for a block that has a finalization.
19301930// We do not care about empty notarizations since the block is finalized.
1931- func (e * Epoch ) finalizedBlockDependency (md BlockHeader ) Digest {
1931+ func (e * Epoch ) finalizedBlockDependency (md BlockHeader ) * Digest {
19321932 if md .Seq == 0 {
19331933 // genesis block has no dependencies
1934- return emptyDigest
1934+ return nil
19351935 }
19361936
19371937 // A block can be scheduled if its predecessor is either notarized or finalized.
@@ -1942,14 +1942,14 @@ func (e *Epoch) finalizedBlockDependency(md BlockHeader) Digest {
19421942 zap .Uint64 ("seq" , md .Seq - 1 ),
19431943 zap .Stringer ("prev" , md .Prev ))
19441944
1945- return emptyDigest
1945+ return nil
19461946 }
19471947
19481948 if notarizedOrFinalized != nil {
1949- return emptyDigest
1949+ return nil
19501950 }
19511951
1952- return md .Prev
1952+ return & md .Prev
19531953}
19541954
19551955// VerifyBlockMessageVote checks if we have the block in the future messages map.
@@ -2142,7 +2142,7 @@ func (e *Epoch) buildBlock() {
21422142 }
21432143
21442144 e .Logger .Debug ("Scheduling block building" , zap .Uint64 ("round" , metadata .Round ))
2145- e .sched .Schedule (task , emptyDigest , []uint64 {})
2145+ e .sched .Schedule (task , nil , []uint64 {})
21462146}
21472147
21482148func (e * Epoch ) retrieveBlacklistOfParentBlock (metadata ProtocolMetadata ) (Blacklist , bool ) {
0 commit comments