aboutsummaryrefslogtreecommitdiffstats
path: root/core/test
diff options
context:
space:
mode:
authorJimmy Hu <jimmy.hu@dexon.org>2019-03-28 13:34:30 +0800
committerGitHub <noreply@github.com>2019-03-28 13:34:30 +0800
commita8b01422da4a66cf2844012c89d46a7d22ac1664 (patch)
tree22f79b20b580bac05774cf1284f6a76e7bdda815 /core/test
parentc0995cb576b840432114011791b39aa904602570 (diff)
downloaddexon-consensus-a8b01422da4a66cf2844012c89d46a7d22ac1664.tar
dexon-consensus-a8b01422da4a66cf2844012c89d46a7d22ac1664.tar.gz
dexon-consensus-a8b01422da4a66cf2844012c89d46a7d22ac1664.tar.bz2
dexon-consensus-a8b01422da4a66cf2844012c89d46a7d22ac1664.tar.lz
dexon-consensus-a8b01422da4a66cf2844012c89d46a7d22ac1664.tar.xz
dexon-consensus-a8b01422da4a66cf2844012c89d46a7d22ac1664.tar.zst
dexon-consensus-a8b01422da4a66cf2844012c89d46a7d22ac1664.zip
core: workaround for GetRoundHeight (#526)
Diffstat (limited to 'core/test')
-rw-r--r--core/test/governance.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/core/test/governance.go b/core/test/governance.go
index 4970420..4ee20d8 100644
--- a/core/test/governance.go
+++ b/core/test/governance.go
@@ -94,6 +94,9 @@ func (g *Governance) Configuration(round uint64) *types.Config {
// GetRoundHeight returns the begin height of a round.
func (g *Governance) GetRoundHeight(round uint64) uint64 {
+ if round == 0 {
+ return 0
+ }
g.lock.RLock()
defer g.lock.RUnlock()
if round >= uint64(len(g.roundBeginHeights)) {