aboutsummaryrefslogtreecommitdiffstats
path: root/core/governance.go
diff options
context:
space:
mode:
authorWei-Ning Huang <w@dexon.org>2019-03-19 15:02:06 +0800
committerWei-Ning Huang <w@byzantine-lab.io>2019-06-12 17:27:23 +0800
commit3dadb841289a41303f84ce96a0478a4f3cb8364c (patch)
treeeaffc06fc4afc8bb1aca5926902be3247f3b8a68 /core/governance.go
parent22314d387813c467038e3cb5c87f99c9d731aeef (diff)
downloadgo-tangerine-3dadb841289a41303f84ce96a0478a4f3cb8364c.tar
go-tangerine-3dadb841289a41303f84ce96a0478a4f3cb8364c.tar.gz
go-tangerine-3dadb841289a41303f84ce96a0478a4f3cb8364c.tar.bz2
go-tangerine-3dadb841289a41303f84ce96a0478a4f3cb8364c.tar.lz
go-tangerine-3dadb841289a41303f84ce96a0478a4f3cb8364c.tar.xz
go-tangerine-3dadb841289a41303f84ce96a0478a4f3cb8364c.tar.zst
go-tangerine-3dadb841289a41303f84ce96a0478a4f3cb8364c.zip
core: vm: add extra checks to prevent DKG spamming (#272)
Add two maps to check the uniqueness of DKGMasterPublicKey and DKGComplaints to prevent malicious actors from spamming it.
Diffstat (limited to 'core/governance.go')
-rw-r--r--core/governance.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/governance.go b/core/governance.go
index 73fb0c923..db0e60b6c 100644
--- a/core/governance.go
+++ b/core/governance.go
@@ -93,10 +93,6 @@ func (g *Governance) GetStateAtRound(round uint64) *vm.GovernanceState {
return &vm.GovernanceState{StateDB: s}
}
-func (g *Governance) GetRoundHeight(round uint64) uint64 {
- return g.GetHeadState().RoundHeight(big.NewInt(int64(round))).Uint64()
-}
-
func (g *Governance) Configuration(round uint64) *coreTypes.Config {
configHelper := g.GetStateForConfigAtRound(round)
c := configHelper.Configuration()
@@ -110,6 +106,10 @@ func (g *Governance) Configuration(round uint64) *coreTypes.Config {
}
}
+func (g *Governance) GetRoundHeight(round uint64) uint64 {
+ return g.GetHeadState().RoundHeight(big.NewInt(int64(round))).Uint64()
+}
+
func (g *Governance) GetStateForDKGAtRound(round uint64) *vm.GovernanceState {
dkgRound := g.GetHeadState().DKGRound().Uint64()
if round > dkgRound {