From 5c408f7fe4f0f0d3e09dc0277e5f8efdd588b543 Mon Sep 17 00:00:00 2001 From: Ekaterina Pavlova Date: Wed, 5 Jun 2024 11:51:44 +0300 Subject: [PATCH] core: adjust prevHeader nil check prevHeader is never nil. Refs #3419 Signed-off-by: Ekaterina Pavlova --- pkg/core/blockchain.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/pkg/core/blockchain.go b/pkg/core/blockchain.go index d5e090044..3e7984aa7 100644 --- a/pkg/core/blockchain.go +++ b/pkg/core/blockchain.go @@ -3017,12 +3017,7 @@ func (bc *Blockchain) verifyTxWitnesses(t *transaction.Transaction, block *block // verifyHeaderWitnesses is a block-specific implementation of VerifyWitnesses logic. func (bc *Blockchain) verifyHeaderWitnesses(currHeader, prevHeader *block.Header) error { - var hash util.Uint160 - if prevHeader == nil && currHeader.PrevHash.Equals(util.Uint256{}) { - hash = currHeader.Script.ScriptHash() - } else { - hash = prevHeader.NextConsensus - } + hash := prevHeader.NextConsensus _, err := bc.VerifyWitness(hash, currHeader, &currHeader.Script, HeaderVerificationGasLimit) return err }