core/vm: correct check for empty hash

This commit is contained in:
Martin Holst Swende 2018-10-03 16:00:06 +02:00
parent 843d483240
commit 4727670df7
No known key found for this signature in database
GPG key ID: 683B438C05A5DDF0
2 changed files with 2 additions and 2 deletions

View file

@ -94,7 +94,7 @@ func (c *Contract) validJumpdest(dest *big.Int) bool {
} }
var analysis bitvec var analysis bitvec
// Do we have a contract hash already? // Do we have a contract hash already?
if c.CodeHash != emptyCodeHash { if c.CodeHash != (common.Hash{}) {
var exist bool var exist bool
// Does parent context have the analysis? // Does parent context have the analysis?
analysis, exist = c.jumpdests[c.CodeHash] analysis, exist = c.jumpdests[c.CodeHash]

View file

@ -358,7 +358,7 @@ type codeAndHash struct {
} }
func (c *codeAndHash) Hash() common.Hash { func (c *codeAndHash) Hash() common.Hash {
if c.hash == emptyCodeHash { if c.hash == (common.Hash{}) {
c.hash = crypto.Keccak256Hash(c.code) c.hash = crypto.Keccak256Hash(c.code)
} }
return c.hash return c.hash