diff options
author | Jimmy Hu <jimmy.hu@dexon.org> | 2019-04-15 18:19:46 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-15 18:19:46 +0800 |
commit | 4a8d6480f7ab074bc032d68df6ee8df5876ef3cc (patch) | |
tree | 54fdb27d6254ecc56f27b7819e9e554c2b1e9f63 /core/governance.go | |
parent | d77c1aa22cb6f2b76af3edf4995159b843838441 (diff) | |
download | dexon-4a8d6480f7ab074bc032d68df6ee8df5876ef3cc.tar dexon-4a8d6480f7ab074bc032d68df6ee8df5876ef3cc.tar.gz dexon-4a8d6480f7ab074bc032d68df6ee8df5876ef3cc.tar.bz2 dexon-4a8d6480f7ab074bc032d68df6ee8df5876ef3cc.tar.lz dexon-4a8d6480f7ab074bc032d68df6ee8df5876ef3cc.tar.xz dexon-4a8d6480f7ab074bc032d68df6ee8df5876ef3cc.tar.zst dexon-4a8d6480f7ab074bc032d68df6ee8df5876ef3cc.zip |
core: implement DKG success (#362)
* vendor: sync to latest core
* core: implmenet dkg success
* cmd: govtool: add DKGSuccess
Diffstat (limited to 'core/governance.go')
-rw-r--r-- | core/governance.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/core/governance.go b/core/governance.go index 39b2704e6..277b3bb89 100644 --- a/core/governance.go +++ b/core/governance.go @@ -310,6 +310,15 @@ func (g *Governance) IsDKGFinal(round uint64) bool { return count >= threshold } +func (g *Governance) IsDKGSuccess(round uint64) bool { + s := g.GetStateForDKGAtRound(round) + if s == nil { + return false + } + return s.DKGSuccessesCount().Uint64() >= + uint64(coreUtils.GetDKGValidThreshold(g.Configuration(round))) +} + func (g *Governance) MinGasPrice(round uint64) *big.Int { return g.GetStateForConfigAtRound(round).MinGasPrice() } |