diff options
author | Jimmy Hu <jimmy.hu@dexon.org> | 2019-04-09 23:39:53 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-09 23:39:53 +0800 |
commit | 3a22fdf183c88a518c9836d625f2b8cf4d2baa76 (patch) | |
tree | 7a4e362c82813e8799a48a3023b00424e20e0edd /dex | |
parent | cb9705fc63c871fcf31b3018a328e4535ba63a28 (diff) | |
download | dexon-3a22fdf183c88a518c9836d625f2b8cf4d2baa76.tar dexon-3a22fdf183c88a518c9836d625f2b8cf4d2baa76.tar.gz dexon-3a22fdf183c88a518c9836d625f2b8cf4d2baa76.tar.bz2 dexon-3a22fdf183c88a518c9836d625f2b8cf4d2baa76.tar.lz dexon-3a22fdf183c88a518c9836d625f2b8cf4d2baa76.tar.xz dexon-3a22fdf183c88a518c9836d625f2b8cf4d2baa76.tar.zst dexon-3a22fdf183c88a518c9836d625f2b8cf4d2baa76.zip |
dex: remove time alignment when force sync (#349)
* vendor: sync to latest core
* dex: remove time alignment when force sync
Diffstat (limited to 'dex')
-rw-r--r-- | dex/blockproposer.go | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/dex/blockproposer.go b/dex/blockproposer.go index 8eaeb9761..d675da4ac 100644 --- a/dex/blockproposer.go +++ b/dex/blockproposer.go @@ -194,7 +194,6 @@ Loop: log.Debug("Listen chain head event until synced") - nextDMoment := time.Now().Unix() // Listen chain head event until synced. ListenLoop: for { @@ -236,26 +235,12 @@ ListenLoop: case <-b.watchCat.Meow(): log.Info("WatchCat signaled to stop syncing") - // Sleep until the next consensus start time slot. - // The interval T_i need to meet the following requirement: - // - // T_i > T_timeout + T_panic + T_restart - // - // Currently, T_timeout = 120, T_panic = 60, T_restart ~ 60 - // - // We set T_i = 600 to be safe. - - interval := int64(600) - nextDMoment = (time.Now().Unix()/interval + 1) * interval - log.Info("Sleeping until next starting time", "time", nextDMoment) - b.dex.protocolManager.SetReceiveCoreMessage(true) - consensusSync.ForceSync(true) + consensusSync.ForceSync(b.watchCat.LastPosition(), true) break ListenLoop } } con, err := consensusSync.GetSyncedConsensus() - time.Sleep(time.Duration(nextDMoment-time.Now().Unix()) * time.Second) return con, err } |