aboutsummaryrefslogtreecommitdiffstats
path: root/dex
diff options
context:
space:
mode:
authorWei-Ning Huang <w@dexon.org>2018-10-22 19:53:24 +0800
committerWei-Ning Huang <w@dexon.org>2019-03-12 12:19:09 +0800
commitd6e47bac7bf55736ff6bad87a77c1452891aa6e3 (patch)
tree90663e63153f0e606fbee1f90622c12c9f96d847 /dex
parente5957ec5894b4e13c555460d7b5e10dc5aad0295 (diff)
downloaddexon-d6e47bac7bf55736ff6bad87a77c1452891aa6e3.tar
dexon-d6e47bac7bf55736ff6bad87a77c1452891aa6e3.tar.gz
dexon-d6e47bac7bf55736ff6bad87a77c1452891aa6e3.tar.bz2
dexon-d6e47bac7bf55736ff6bad87a77c1452891aa6e3.tar.lz
dexon-d6e47bac7bf55736ff6bad87a77c1452891aa6e3.tar.xz
dexon-d6e47bac7bf55736ff6bad87a77c1452891aa6e3.tar.zst
dexon-d6e47bac7bf55736ff6bad87a77c1452891aa6e3.zip
dex: fix round switching and initialize dMoment correctly
Diffstat (limited to 'dex')
-rw-r--r--dex/backend.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/dex/backend.go b/dex/backend.go
index 9c931ee2c..2ad7c16be 100644
--- a/dex/backend.go
+++ b/dex/backend.go
@@ -174,7 +174,14 @@ func New(ctx *node.ServiceContext, config *Config) (*Dexon, error) {
dex.network = NewDexconNetwork(pm)
privKey := coreEcdsa.NewPrivateKeyFromECDSA(config.PrivateKey)
- dMoment := time.Date(2018, 10, 15, 6, 0, 0, 0, time.UTC)
+
+ // TODO(w): set this correctly in config.
+ now := time.Now()
+ dMoment := time.Date(
+ now.Year(), now.Month(), now.Day(),
+ now.Hour(), now.Minute(), (now.Second()/5+1)*5,
+ 0, now.Location())
+
dex.consensus = dexCore.NewConsensus(dMoment,
dex.app, dex.governance, db, dex.network, privKey, log.Root())
return dex, nil