From 15be90c811e6fc6324033b482320da0e5fa694e5 Mon Sep 17 00:00:00 2001 From: Jimmy Hu Date: Tue, 16 Oct 2018 11:34:05 +0800 Subject: core: Change First round dkg timing (#209) --- core/consensus.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'core/consensus.go') 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) -- cgit v1.2.3