aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSonic <sonic@dexon.org>2019-01-08 13:10:02 +0800
committerWei-Ning Huang <w@dexon.org>2019-04-09 21:32:56 +0800
commit85d3ca56cbca94c9f78e59fc19791bed9be5b11e (patch)
tree33eed3cedf40efe309da282bfdee870fafe01c94
parent9c110d37d09d40235b140ca7197515d5c60052c4 (diff)
downloadgo-tangerine-85d3ca56cbca94c9f78e59fc19791bed9be5b11e.tar
go-tangerine-85d3ca56cbca94c9f78e59fc19791bed9be5b11e.tar.gz
go-tangerine-85d3ca56cbca94c9f78e59fc19791bed9be5b11e.tar.bz2
go-tangerine-85d3ca56cbca94c9f78e59fc19791bed9be5b11e.tar.lz
go-tangerine-85d3ca56cbca94c9f78e59fc19791bed9be5b11e.tar.xz
go-tangerine-85d3ca56cbca94c9f78e59fc19791bed9be5b11e.tar.zst
go-tangerine-85d3ca56cbca94c9f78e59fc19791bed9be5b11e.zip
core: fix corner case when initializing round height (#134)
-rw-r--r--core/blockchain.go2
1 files changed, 1 insertions, 1 deletions
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")