From 0382bbafbee5ffb820b9d31f7cfe8f6a48968a48 Mon Sep 17 00:00:00 2001 From: Jimmy Hu Date: Tue, 2 Apr 2019 17:07:05 +0800 Subject: core: optimize message handle (#542) * core: optimize for handling agremenet result * core: disable clone vote * core: touch npks --- core/configuration-chain.go | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'core/configuration-chain.go') diff --git a/core/configuration-chain.go b/core/configuration-chain.go index c8aac38..fbd504d 100644 --- a/core/configuration-chain.go +++ b/core/configuration-chain.go @@ -586,8 +586,19 @@ func (cc *configurationChain) recoverDKGInfo( // Restore group public key. cc.logger.Debug("Calling Governance.DKGMasterPublicKeys for recoverDKGInfo", "round", round) + mpk := cc.gov.DKGMasterPublicKeys(round) cc.logger.Debug("Calling Governance.DKGComplaints for recoverDKGInfo", "round", round) + comps := cc.gov.DKGComplaints(round) + qualifies, _, err := typesDKG.CalcQualifyNodes(mpk, comps, threshold) + if err != nil { + return err + } + if len(qualifies) < + utils.GetDKGValidThreshold(utils.GetConfigWithPanic( + cc.gov, round, cc.logger)) { + return typesDKG.ErrNotReachThreshold + } npks, err := typesDKG.NewNodePublicKeys(round, cc.gov.DKGMasterPublicKeys(round), cc.gov.DKGComplaints(round), -- cgit v1.2.3