diff options
author | Wei-Ning Huang <w@dexon.org> | 2019-03-19 15:02:06 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2019-04-09 21:32:58 +0800 |
commit | fff05d83302f6c168409e9e614cd9da7d43bc94a (patch) | |
tree | 0acb4bd090edd475ffe75bfcd2c7e95dd7ed7fa7 /core/governance.go | |
parent | fa793b8d7eeb3601c9b028544f2033228aa95b33 (diff) | |
download | go-tangerine-fff05d83302f6c168409e9e614cd9da7d43bc94a.tar go-tangerine-fff05d83302f6c168409e9e614cd9da7d43bc94a.tar.gz go-tangerine-fff05d83302f6c168409e9e614cd9da7d43bc94a.tar.bz2 go-tangerine-fff05d83302f6c168409e9e614cd9da7d43bc94a.tar.lz go-tangerine-fff05d83302f6c168409e9e614cd9da7d43bc94a.tar.xz go-tangerine-fff05d83302f6c168409e9e614cd9da7d43bc94a.tar.zst go-tangerine-fff05d83302f6c168409e9e614cd9da7d43bc94a.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.go | 8 |
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 { |