aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSonic <sonic@dexon.org>2019-01-08 13:10:02 +0800
committerWei-Ning Huang <w@dexon.org>2019-03-12 12:19:09 +0800
commit89b17f1293305ecf7cba6067c3da5cf62dea4dfa (patch)
tree50c07fcb489dc5be49073f41e9b149478777633e
parent7285c3b0af76e2e470ba3917b006264a06644246 (diff)
downloaddexon-89b17f1293305ecf7cba6067c3da5cf62dea4dfa.tar.gz
dexon-89b17f1293305ecf7cba6067c3da5cf62dea4dfa.tar.zst
dexon-89b17f1293305ecf7cba6067c3da5cf62dea4dfa.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 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")