aboutsummaryrefslogtreecommitdiffstats
path: root/core/consensus.go
diff options
context:
space:
mode:
authorJimmy Hu <jimmy.hu@dexon.org>2018-10-16 11:34:05 +0800
committerGitHub <noreply@github.com>2018-10-16 11:34:05 +0800
commit15be90c811e6fc6324033b482320da0e5fa694e5 (patch)
tree39fe00fffe1fe587b53a864d40439f79f6895524 /core/consensus.go
parent4ec958aad80f02086f87bf300ce7ba676618d5fc (diff)
downloaddexon-consensus-15be90c811e6fc6324033b482320da0e5fa694e5.tar
dexon-consensus-15be90c811e6fc6324033b482320da0e5fa694e5.tar.gz
dexon-consensus-15be90c811e6fc6324033b482320da0e5fa694e5.tar.bz2
dexon-consensus-15be90c811e6fc6324033b482320da0e5fa694e5.tar.lz
dexon-consensus-15be90c811e6fc6324033b482320da0e5fa694e5.tar.xz
dexon-consensus-15be90c811e6fc6324033b482320da0e5fa694e5.tar.zst
dexon-consensus-15be90c811e6fc6324033b482320da0e5fa694e5.zip
core: Change First round dkg timing (#209)
Diffstat (limited to 'core/consensus.go')
-rw-r--r--core/consensus.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/core/consensus.go b/core/consensus.go
index 00d5bc7..e8d8b15 100644
--- a/core/consensus.go
+++ b/core/consensus.go
@@ -267,9 +267,6 @@ func NewConsensus(
network: network,
},
gov)
- // Register DKG for the initial round. This is a temporary function call for
- // simulation.
- cfgModule.registerDKG(round, int(config.DKGSetSize)/3+1)
// Construct Consensus instance.
con := &Consensus{
ID: ID,
@@ -319,7 +316,11 @@ func NewConsensus(
// Run starts running DEXON Consensus.
func (con *Consensus) Run() {
go con.processMsg(con.network.ReceiveChan())
- con.runDKGTSIG(con.round)
+ con.cfgModule.registerDKG(con.round, int(con.currentConfig.DKGSetSize)/3+1)
+ con.event.RegisterTime(con.dMoment.Add(con.currentConfig.RoundInterval/4),
+ func(time.Time) {
+ con.runDKGTSIG(con.round)
+ })
round1 := uint64(1)
con.lattice.AppendConfig(round1, con.gov.Configuration(round1))
con.initialRound(con.dMoment)