core: gracefully handle missing homestead block config

This commit is contained in:
Péter Szilágyi
2016-07-08 11:43:36 +03:00
parent 6060e098c9
commit 9e56811a37
2 changed files with 106 additions and 1 deletions

View File

@ -39,7 +39,7 @@ type ChainConfig struct {
// IsHomestead returns whether num is either equal to the homestead block or greater.
func (c *ChainConfig) IsHomestead(num *big.Int) bool {
if num == nil {
if c.HomesteadBlock == nil || num == nil {
return false
}
return num.Cmp(c.HomesteadBlock) >= 0