mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-25 13:47:19 +00:00
core: adjust prevHeader nil check
prevHeader is never nil. Refs #3419 Signed-off-by: Ekaterina Pavlova <ekt@morphbits.io>
This commit is contained in:
parent
cd525a1df5
commit
5c408f7fe4
1 changed files with 1 additions and 6 deletions
|
@ -3017,12 +3017,7 @@ func (bc *Blockchain) verifyTxWitnesses(t *transaction.Transaction, block *block
|
||||||
|
|
||||||
// verifyHeaderWitnesses is a block-specific implementation of VerifyWitnesses logic.
|
// verifyHeaderWitnesses is a block-specific implementation of VerifyWitnesses logic.
|
||||||
func (bc *Blockchain) verifyHeaderWitnesses(currHeader, prevHeader *block.Header) error {
|
func (bc *Blockchain) verifyHeaderWitnesses(currHeader, prevHeader *block.Header) error {
|
||||||
var hash util.Uint160
|
hash := prevHeader.NextConsensus
|
||||||
if prevHeader == nil && currHeader.PrevHash.Equals(util.Uint256{}) {
|
|
||||||
hash = currHeader.Script.ScriptHash()
|
|
||||||
} else {
|
|
||||||
hash = prevHeader.NextConsensus
|
|
||||||
}
|
|
||||||
_, err := bc.VerifyWitness(hash, currHeader, &currHeader.Script, HeaderVerificationGasLimit)
|
_, err := bc.VerifyWitness(hash, currHeader, &currHeader.Script, HeaderVerificationGasLimit)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue