diff options
author | Jimmy Hu <jimmy.hu@dexon.org> | 2019-03-28 13:34:30 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-28 13:34:30 +0800 |
commit | a8b01422da4a66cf2844012c89d46a7d22ac1664 (patch) | |
tree | 22f79b20b580bac05774cf1284f6a76e7bdda815 /core/test/governance.go | |
parent | c0995cb576b840432114011791b39aa904602570 (diff) | |
download | dexon-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/governance.go')
-rw-r--r-- | core/test/governance.go | 3 |
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)) { |