diff options
author | Wei-Ning Huang <w@dexon.org> | 2018-10-22 19:53:24 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2019-04-09 13:49:54 +0800 |
commit | 28d4e46de9d79952861d23950a5b5116fdbeebea (patch) | |
tree | 9e8be5358d6d3853512401b4d9470772f227f3d9 /dex | |
parent | ab838886bb7e378f87542cc37962637c6f8667da (diff) | |
download | dexon-28d4e46de9d79952861d23950a5b5116fdbeebea.tar dexon-28d4e46de9d79952861d23950a5b5116fdbeebea.tar.gz dexon-28d4e46de9d79952861d23950a5b5116fdbeebea.tar.bz2 dexon-28d4e46de9d79952861d23950a5b5116fdbeebea.tar.lz dexon-28d4e46de9d79952861d23950a5b5116fdbeebea.tar.xz dexon-28d4e46de9d79952861d23950a5b5116fdbeebea.tar.zst dexon-28d4e46de9d79952861d23950a5b5116fdbeebea.zip |
dex: fix round switching and initialize dMoment correctly
Diffstat (limited to 'dex')
-rw-r--r-- | dex/backend.go | 9 |
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 |