From 1a70d5eb66cdbf8a23791806b71a323eed320085 Mon Sep 17 00:00:00 2001 From: frozen <355847+Frozen@users.noreply.github.com> Date: Tue, 21 Mar 2023 18:34:07 -0300 Subject: [PATCH] Fix possible panic. --- core/blockchain_stub.go | 4 ---- core/epochchain.go | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/core/blockchain_stub.go b/core/blockchain_stub.go index f9e9111ea..f1c27f574 100644 --- a/core/blockchain_stub.go +++ b/core/blockchain_stub.go @@ -141,10 +141,6 @@ func (a Stub) Config() *params.ChainConfig { return nil } -func (a Stub) Engine() engine.Engine { - return nil -} - func (a Stub) SubscribeRemovedLogsEvent(ch chan<- RemovedLogsEvent) event.Subscription { return nil } diff --git a/core/epochchain.go b/core/epochchain.go index 661d34ee4..507142f39 100644 --- a/core/epochchain.go +++ b/core/epochchain.go @@ -128,7 +128,7 @@ func (bc *EpochChain) InsertChain(blocks types.Blocks, _ bool) (int, error) { } // Signature validation. - err = bc.Engine().VerifyHeaderSignature(bc, block.Header(), sig, bitmap) + err = chain.Engine().VerifyHeaderSignature(bc, block.Header(), sig, bitmap) if err != nil { return i, errors.Wrap(err, "failed signature validation") }