diff options
author | Jimmy Hu <jimmy.hu@dexon.org> | 2019-04-02 17:07:05 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-02 17:07:05 +0800 |
commit | 0382bbafbee5ffb820b9d31f7cfe8f6a48968a48 (patch) | |
tree | 3140508a5528d73e4cf4cca145800dfa3ba7ed7a /core/configuration-chain.go | |
parent | 35f3fe0b857e8006de345505d7fc09c0b7c10326 (diff) | |
download | dexon-consensus-0382bbafbee5ffb820b9d31f7cfe8f6a48968a48.tar dexon-consensus-0382bbafbee5ffb820b9d31f7cfe8f6a48968a48.tar.gz dexon-consensus-0382bbafbee5ffb820b9d31f7cfe8f6a48968a48.tar.bz2 dexon-consensus-0382bbafbee5ffb820b9d31f7cfe8f6a48968a48.tar.lz dexon-consensus-0382bbafbee5ffb820b9d31f7cfe8f6a48968a48.tar.xz dexon-consensus-0382bbafbee5ffb820b9d31f7cfe8f6a48968a48.tar.zst dexon-consensus-0382bbafbee5ffb820b9d31f7cfe8f6a48968a48.zip |
core: optimize message handle (#542)
* core: optimize for handling agremenet result
* core: disable clone vote
* core: touch npks
Diffstat (limited to 'core/configuration-chain.go')
-rw-r--r-- | core/configuration-chain.go | 11 |
1 files changed, 11 insertions, 0 deletions
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), |