From 83dc18e7f10d60428a1da15de2842e284059ef67 Mon Sep 17 00:00:00 2001 From: Leo Chen Date: Sat, 23 May 2020 23:50:22 -0700 Subject: [PATCH] fix nil pointer crash Signed-off-by: Leo Chen --- internal/chain/engine.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/chain/engine.go b/internal/chain/engine.go index 60bb4141b..1b3eb1ade 100644 --- a/internal/chain/engine.go +++ b/internal/chain/engine.go @@ -172,6 +172,9 @@ func (e *engineImpl) VerifySeal(chain engine.ChainReader, header *block.Header) if chain.CurrentHeader().Number().Uint64() <= uint64(1) { return nil } + if header == nil { + return errors.New("[VerifySeal] nil block header") + } publicKeys, err := ReadPublicKeysFromLastBlock(chain, header) if err != nil {