aboutsummaryrefslogtreecommitdiffstats
path: root/core/governance.go
diff options
context:
space:
mode:
authorJimmy Hu <jimmy.hu@dexon.org>2018-12-21 12:03:28 +0800
committerWei-Ning Huang <w@dexon.org>2019-04-09 21:32:55 +0800
commit0c9666161c9630edf8eca571e7c93db7d21dfba3 (patch)
tree600f05c67b7e7f1241bc67ea1fbd4653e6681786 /core/governance.go
parentcb681396102175b1651363b3060c5b759a3ee9b2 (diff)
downloadgo-tangerine-0c9666161c9630edf8eca571e7c93db7d21dfba3.tar
go-tangerine-0c9666161c9630edf8eca571e7c93db7d21dfba3.tar.gz
go-tangerine-0c9666161c9630edf8eca571e7c93db7d21dfba3.tar.bz2
go-tangerine-0c9666161c9630edf8eca571e7c93db7d21dfba3.tar.lz
go-tangerine-0c9666161c9630edf8eca571e7c93db7d21dfba3.tar.xz
go-tangerine-0c9666161c9630edf8eca571e7c93db7d21dfba3.tar.zst
go-tangerine-0c9666161c9630edf8eca571e7c93db7d21dfba3.zip
core: vm: Add `MPKReady` to governance (#97)
* core/vm: Add DKGMPKReady * param: update GenesisHash * vendor: sync to latest core
Diffstat (limited to 'core/governance.go')
-rw-r--r--core/governance.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/core/governance.go b/core/governance.go
index ea0036a0e..45594fb64 100644
--- a/core/governance.go
+++ b/core/governance.go
@@ -121,6 +121,14 @@ func (g *Governance) DKGMasterPublicKeys(round uint64) []*dkgTypes.MasterPublicK
return headHelper.UniqueDKGMasterPublicKeys(big.NewInt(int64(round)))
}
+func (g *Governance) IsDKGMPKReady(round uint64) bool {
+ headHelper := g.GetHeadHelper()
+ config := g.Configuration(round)
+ threshold := 2*uint64(config.DKGSetSize)/3 + 1
+ count := headHelper.DKGMPKReadysCount(big.NewInt(int64(round))).Uint64()
+ return count >= threshold
+}
+
func (g *Governance) IsDKGFinal(round uint64) bool {
headHelper := g.GetHeadHelper()
config := g.Configuration(round)