aboutsummaryrefslogtreecommitdiffstats
path: root/core/consensus.go
diff options
context:
space:
mode:
authorJimmy Hu <jimmy.hu@dexon.org>2018-10-15 15:58:41 +0800
committerWei-Ning Huang <aitjcize@gmail.com>2018-10-15 15:58:41 +0800
commit39cf951c427179e432861473fa4e2f67810dff22 (patch)
tree11d787e8d0e771b822f67cdd3b63865e0b91a42b /core/consensus.go
parent3c1b208090f4455344fade2a218d332300d76458 (diff)
downloaddexon-consensus-39cf951c427179e432861473fa4e2f67810dff22.tar
dexon-consensus-39cf951c427179e432861473fa4e2f67810dff22.tar.gz
dexon-consensus-39cf951c427179e432861473fa4e2f67810dff22.tar.bz2
dexon-consensus-39cf951c427179e432861473fa4e2f67810dff22.tar.lz
dexon-consensus-39cf951c427179e432861473fa4e2f67810dff22.tar.xz
dexon-consensus-39cf951c427179e432861473fa4e2f67810dff22.tar.zst
dexon-consensus-39cf951c427179e432861473fa4e2f67810dff22.zip
Remove duplicated dMoment in Consensus.Run (#206)
Diffstat (limited to 'core/consensus.go')
-rw-r--r--core/consensus.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/core/consensus.go b/core/consensus.go
index 526ced5..368970c 100644
--- a/core/consensus.go
+++ b/core/consensus.go
@@ -215,6 +215,7 @@ type Consensus struct {
tickerObj Ticker
// Misc.
+ dMoment time.Time
nodeSetCache *NodeSetCache
round uint64
lock sync.RWMutex
@@ -282,6 +283,7 @@ func NewConsensus(
tickerObj: newTicker(gov, round, TickerBA),
dkgReady: sync.NewCond(&sync.Mutex{}),
cfgModule: cfgModule,
+ dMoment: dMoment,
nodeSetCache: nodeSetCache,
ctx: ctx,
ctxCancel: ctxCancel,
@@ -315,12 +317,12 @@ func NewConsensus(
}
// Run starts running DEXON Consensus.
-func (con *Consensus) Run(dMoment time.Time) {
+func (con *Consensus) Run() {
go con.processMsg(con.network.ReceiveChan())
con.runDKGTSIG(con.round)
round1 := uint64(1)
con.lattice.AppendConfig(round1, con.gov.Configuration(round1))
- con.initialRound(dMoment)
+ con.initialRound(con.dMoment)
ticks := make([]chan struct{}, 0, con.currentConfig.NumChains)
for i := uint32(0); i < con.currentConfig.NumChains; i++ {
tick := make(chan struct{})