aboutsummaryrefslogtreecommitdiffstats
path: root/dex/backend.go
diff options
context:
space:
mode:
authorWei-Ning Huang <w@dexon.org>2018-10-22 19:53:24 +0800
committerWei-Ning Huang <w@dexon.org>2018-12-19 20:54:27 +0800
commit5a4b1cbce0cba3af5492646d01ee5d9c0b2a6a72 (patch)
treee058a11fc6d9616255e3ae0c22e1a620703bc3ec /dex/backend.go
parent9320531a4a2add2ac3132257d04761aff078ff17 (diff)
downloaddexon-5a4b1cbce0cba3af5492646d01ee5d9c0b2a6a72.tar
dexon-5a4b1cbce0cba3af5492646d01ee5d9c0b2a6a72.tar.gz
dexon-5a4b1cbce0cba3af5492646d01ee5d9c0b2a6a72.tar.bz2
dexon-5a4b1cbce0cba3af5492646d01ee5d9c0b2a6a72.tar.lz
dexon-5a4b1cbce0cba3af5492646d01ee5d9c0b2a6a72.tar.xz
dexon-5a4b1cbce0cba3af5492646d01ee5d9c0b2a6a72.tar.zst
dexon-5a4b1cbce0cba3af5492646d01ee5d9c0b2a6a72.zip
dex: fix round switching and initialize dMoment correctly
Diffstat (limited to 'dex/backend.go')
-rw-r--r--dex/backend.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/dex/backend.go b/dex/backend.go
index dd2312e35..ce9db8e5d 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