Keep nil epoch check just in case

pull/1508/head
Eugene Kim 5 years ago
parent e1dff26b84
commit 342dca1efe
  1. 4
      core/rawdb/accessors_chain.go

@ -350,6 +350,10 @@ func WriteBlock(db DatabaseWriter, block *types.Block) {
WriteHeader(db, block.Header()) WriteHeader(db, block.Header())
// TODO ek – maybe roll the below into WriteHeader() // TODO ek – maybe roll the below into WriteHeader()
epoch := block.Header().Epoch() epoch := block.Header().Epoch()
if epoch == nil {
// backward compatibility
return
}
epochBlockNum := block.Number() epochBlockNum := block.Number()
writeOne := func() { writeOne := func() {
if err := WriteEpochBlockNumber(db, epoch, epochBlockNum); err != nil { if err := WriteEpochBlockNumber(db, epoch, epochBlockNum); err != nil {

Loading…
Cancel
Save