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 {