aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorWei-Ning Huang <w@dexon.org>2018-10-22 19:53:24 +0800
committerWei-Ning Huang <w@dexon.org>2019-03-12 12:19:09 +0800
commitd6e47bac7bf55736ff6bad87a77c1452891aa6e3 (patch)
tree90663e63153f0e606fbee1f90622c12c9f96d847 /core
parente5957ec5894b4e13c555460d7b5e10dc5aad0295 (diff)
downloaddexon-d6e47bac7bf55736ff6bad87a77c1452891aa6e3.tar.gz
dexon-d6e47bac7bf55736ff6bad87a77c1452891aa6e3.tar.zst
dexon-d6e47bac7bf55736ff6bad87a77c1452891aa6e3.zip
dex: fix round switching and initialize dMoment correctly
Diffstat (limited to 'core')
-rw-r--r--core/vm/governance.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/vm/governance.go b/core/vm/governance.go
index 5e6cc0b4d..d30987b11 100644
--- a/core/vm/governance.go
+++ b/core/vm/governance.go
@@ -1413,7 +1413,8 @@ func (g *GovernanceContract) addDKGComplaint(round *big.Int, comp []byte) ([]byt
}
func (g *GovernanceContract) addDKGMasterPublicKey(round *big.Int, mpk []byte) ([]byte, error) {
- if round.Cmp(g.state.Round()) != 0 {
+ // Can only add DKG master public key of current and next round.
+ if round.Cmp(new(big.Int).Add(g.state.Round(), big.NewInt(1))) > 0 {
g.penalize()
return nil, errExecutionReverted
}