aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com
diff options
context:
space:
mode:
authorWei-Ning Huang <w@dexon.org>2019-01-02 18:58:59 +0800
committerWei-Ning Huang <w@dexon.org>2019-04-09 21:32:55 +0800
commit0f028c2ff44708ee98ca87e27691f87fa7b7e6d9 (patch)
treec3d246d41c232b19e5a3b8ec7ed30747c41e9301 /vendor/github.com
parent4e5dae94944abed607fc2e184dfb26267c5fa541 (diff)
downloaddexon-0f028c2ff44708ee98ca87e27691f87fa7b7e6d9.tar
dexon-0f028c2ff44708ee98ca87e27691f87fa7b7e6d9.tar.gz
dexon-0f028c2ff44708ee98ca87e27691f87fa7b7e6d9.tar.bz2
dexon-0f028c2ff44708ee98ca87e27691f87fa7b7e6d9.tar.lz
dexon-0f028c2ff44708ee98ca87e27691f87fa7b7e6d9.tar.xz
dexon-0f028c2ff44708ee98ca87e27691f87fa7b7e6d9.tar.zst
dexon-0f028c2ff44708ee98ca87e27691f87fa7b7e6d9.zip
vendor: sync to latest core (#121)
Diffstat (limited to 'vendor/github.com')
-rw-r--r--vendor/github.com/dexon-foundation/dexon-consensus/core/consensus.go15
1 files changed, 9 insertions, 6 deletions
diff --git a/vendor/github.com/dexon-foundation/dexon-consensus/core/consensus.go b/vendor/github.com/dexon-foundation/dexon-consensus/core/consensus.go
index 3353d1d60..faadbe9bd 100644
--- a/vendor/github.com/dexon-foundation/dexon-consensus/core/consensus.go
+++ b/vendor/github.com/dexon-foundation/dexon-consensus/core/consensus.go
@@ -563,14 +563,17 @@ func (con *Consensus) prepare(initBlock *types.Block) error {
if err != nil {
return err
}
- // TODO(jimmy): registerDKG should be called after dmoment.
if _, exist := dkgSet[con.ID]; exist {
con.logger.Info("Selected as DKG set", "round", initRound)
- con.cfgModule.registerDKG(initRound, getDKGThreshold(initConfig))
- con.event.RegisterTime(con.dMoment.Add(initConfig.RoundInterval/4),
- func(time.Time) {
- con.runDKG(initRound, initConfig)
- })
+ go func() {
+ // Sleep until dMoment come.
+ time.Sleep(con.dMoment.Sub(time.Now().UTC()))
+ con.cfgModule.registerDKG(initRound, getDKGThreshold(initConfig))
+ con.event.RegisterTime(con.dMoment.Add(initConfig.RoundInterval/4),
+ func(time.Time) {
+ con.runDKG(initRound, initConfig)
+ })
+ }()
}
con.initialRound(con.dMoment, initRound, initConfig)
return nil