From 342dca1efe952834101277f501ad8bd47b234d38 Mon Sep 17 00:00:00 2001 From: Eugene Kim Date: Wed, 4 Sep 2019 12:23:02 -0700 Subject: [PATCH] Keep nil epoch check just in case --- core/rawdb/accessors_chain.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/rawdb/accessors_chain.go b/core/rawdb/accessors_chain.go index 7e2f98607..a07c438ae 100644 --- a/core/rawdb/accessors_chain.go +++ b/core/rawdb/accessors_chain.go @@ -350,6 +350,10 @@ func WriteBlock(db DatabaseWriter, block *types.Block) { WriteHeader(db, block.Header()) // TODO ek – maybe roll the below into WriteHeader() epoch := block.Header().Epoch() + if epoch == nil { + // backward compatibility + return + } epochBlockNum := block.Number() writeOne := func() { if err := WriteEpochBlockNumber(db, epoch, epochBlockNum); err != nil {