From ae6b80de810fbe3e1dc6a2b985cf949881ec24a9 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/blockchain.go') diff --git a/core/blockchain.go b/core/blockchain.go index e83702065..089f1c2fa 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