From 82f1f1a5566d1870466b25545986b7c00fff105d Mon Sep 17 00:00:00 2001 From: Jimmy Hu Date: Tue, 16 Apr 2019 18:41:00 +0800 Subject: core: vm: clearDKG in resetDKG (#368) --- core/vm/oracle_contracts.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'core/vm') diff --git a/core/vm/oracle_contracts.go b/core/vm/oracle_contracts.go index 9adf98e53..4a93c9805 100644 --- a/core/vm/oracle_contracts.go +++ b/core/vm/oracle_contracts.go @@ -2042,6 +2042,14 @@ func (g *GovernanceContract) resetDKG(newSignedCRS []byte) ([]byte, error) { round := g.evm.Round nextRound := new(big.Int).Add(round, big.NewInt(1)) + // If no one call addDKGMasterPublicKey, DKG of previous round will not be + // cleared. + if g.state.DKGRound().Cmp(round) == 0 { + // Clear DKG states for next round. + g.clearDKG() + g.state.SetDKGRound(nextRound) + } + resetCount := g.state.DKGResetCount(nextRound) // Just restart DEXON if failed at round 0. -- cgit v1.2.3