diff options
Diffstat (limited to 'core/consensus.go')
-rw-r--r-- | core/consensus.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/core/consensus.go b/core/consensus.go index 6d0f683..2246bf1 100644 --- a/core/consensus.go +++ b/core/consensus.go @@ -849,17 +849,21 @@ func (con *Consensus) prepare(initBlock *types.Block) (err error) { "reset", e.Reset) return false } - if _, err := typesDKG.NewGroupPublicKey( + gpk, err := typesDKG.NewGroupPublicKey( nextRound, con.gov.DKGMasterPublicKeys(nextRound), con.gov.DKGComplaints(nextRound), - utils.GetDKGThreshold(nextConfig)); err != nil { + utils.GetDKGThreshold(nextConfig)) + if err != nil { con.logger.Error("Next DKG failed to prepare, reset it", "round", e.Round, "reset", e.Reset, "error", err) return false } + if len(gpk.QualifyNodeIDs) < utils.GetDKGValidThreshold(nextConfig) { + return false + } return true } con.event.RegisterHeight(e.NextDKGResetHeight(), func(uint64) { |