aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorJimmy Hu <jimmy.hu@dexon.org>2018-12-04 10:10:17 +0800
committerMission Liao <mission.liao@dexon.org>2018-12-04 10:10:17 +0800
commit0be7c830e4f96a7ae1a957c4bb12772447617076 (patch)
tree3cadafadf998446a01a322230c41c9d2f7527a5b /core
parent041eb53f043e6a4a7a9acab1ce46ecfd268fed57 (diff)
downloaddexon-consensus-0be7c830e4f96a7ae1a957c4bb12772447617076.tar
dexon-consensus-0be7c830e4f96a7ae1a957c4bb12772447617076.tar.gz
dexon-consensus-0be7c830e4f96a7ae1a957c4bb12772447617076.tar.bz2
dexon-consensus-0be7c830e4f96a7ae1a957c4bb12772447617076.tar.lz
dexon-consensus-0be7c830e4f96a7ae1a957c4bb12772447617076.tar.xz
dexon-consensus-0be7c830e4f96a7ae1a957c4bb12772447617076.tar.zst
dexon-consensus-0be7c830e4f96a7ae1a957c4bb12772447617076.zip
core: Fix stuffs (#354)
- Add common.CustomLogger - CRS will wait for DKG to finish - Fix core.agreementMgr.processAgreementResult
Diffstat (limited to 'core')
-rw-r--r--core/agreement-mgr.go4
-rw-r--r--core/consensus.go9
2 files changed, 11 insertions, 2 deletions
diff --git a/core/agreement-mgr.go b/core/agreement-mgr.go
index cbce6d2..57fb5c5 100644
--- a/core/agreement-mgr.go
+++ b/core/agreement-mgr.go
@@ -251,8 +251,8 @@ func (mgr *agreementMgr) processAgreementResult(
nIDs := nodes.GetSubSet(
int(mgr.gov.Configuration(result.Position.Round).NotarySetSize),
types.NewNotarySetTarget(crs, result.Position.ChainID))
- for _, vote := range result.Votes {
- agreement.processVote(&vote)
+ for key := range result.Votes {
+ agreement.processVote(&result.Votes[key])
}
agreement.restart(nIDs, result.Position, crs)
}
diff --git a/core/consensus.go b/core/consensus.go
index efd3ab7..a1aa072 100644
--- a/core/consensus.go
+++ b/core/consensus.go
@@ -611,6 +611,15 @@ func (con *Consensus) runCRS(round uint64) {
con.logger.Info("CRS already proposed", "round", round+1)
return
}
+ con.logger.Debug("Calling Governance.IsDKGFinal to check if ready to run CRS",
+ "round", round)
+ for !con.gov.IsDKGFinal(round) {
+ con.logger.Debug("DKG is not ready for running CRS. Retry later...",
+ "round", round)
+ time.Sleep(500 * time.Millisecond)
+ }
+ // Wait some time for DKG to recover private share.
+ time.Sleep(100 * time.Millisecond)
// Start running next round CRS.
con.logger.Debug("Calling Governance.CRS", "round", round)
psig, err := con.cfgModule.preparePartialSignature(round, con.gov.CRS(round))