diff options
author | Jimmy Hu <jimmy.hu@dexon.org> | 2019-04-09 23:39:53 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@byzantine-lab.io> | 2019-06-15 22:09:55 +0800 |
commit | 33e70e61e04cfab68bcb6ce26665f7947be77a5f (patch) | |
tree | c125643c54dd2eb7eeff2970d434a6649d62ec4d /dex/blockproposer.go | |
parent | 11fa8f2a179ec3b871ee143c0d1bc9115a0f074e (diff) | |
download | go-tangerine-33e70e61e04cfab68bcb6ce26665f7947be77a5f.tar go-tangerine-33e70e61e04cfab68bcb6ce26665f7947be77a5f.tar.gz go-tangerine-33e70e61e04cfab68bcb6ce26665f7947be77a5f.tar.bz2 go-tangerine-33e70e61e04cfab68bcb6ce26665f7947be77a5f.tar.lz go-tangerine-33e70e61e04cfab68bcb6ce26665f7947be77a5f.tar.xz go-tangerine-33e70e61e04cfab68bcb6ce26665f7947be77a5f.tar.zst go-tangerine-33e70e61e04cfab68bcb6ce26665f7947be77a5f.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/blockproposer.go')
-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 } |