From 89b17f1293305ecf7cba6067c3da5cf62dea4dfa Mon Sep 17 00:00:00 2001 From: Sonic Date: Tue, 8 Jan 2019 13:10:02 +0800 Subject: core: fix corner case when initializing round height (#134) --- core/blockchain.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core') diff --git a/core/blockchain.go b/core/blockchain.go index 73e820c32..b375e4609 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -251,7 +251,7 @@ func NewBlockChain(db ethdb.Database, cacheConfig *CacheConfig, chainConfig *par bc.storeRoundHeight(uint64(0), uint64(0)) } else { prevh := gov.GetRoundHeight(r - 1) - if prevh == uint64(0) { + if prevh == uint64(0) && (r-1) != uint64(0) { // Previous round height should be already snapshoted // in governance state at this moment. panic("can not init previous round height map") -- cgit v1.2.3