diff options
author | Jimmy Hu <jimmy.hu@dexon.org> | 2018-10-18 17:37:22 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-18 17:37:22 +0800 |
commit | d2f8010e74b715c490fda75984dde2fab2a7b03a (patch) | |
tree | 9bdb3edde2044dc6651ee872a09baa474107f34a | |
parent | 3b3d02f94519a1fd38936d2f7f2dda09e1b5a534 (diff) | |
download | dexon-consensus-d2f8010e74b715c490fda75984dde2fab2a7b03a.tar dexon-consensus-d2f8010e74b715c490fda75984dde2fab2a7b03a.tar.gz dexon-consensus-d2f8010e74b715c490fda75984dde2fab2a7b03a.tar.bz2 dexon-consensus-d2f8010e74b715c490fda75984dde2fab2a7b03a.tar.lz dexon-consensus-d2f8010e74b715c490fda75984dde2fab2a7b03a.tar.xz dexon-consensus-d2f8010e74b715c490fda75984dde2fab2a7b03a.tar.zst dexon-consensus-d2f8010e74b715c490fda75984dde2fab2a7b03a.zip |
core: Append all config till Initial block (#225)
-rw-r--r-- | core/consensus.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/core/consensus.go b/core/consensus.go index d3f8b5d..05e3301 100644 --- a/core/consensus.go +++ b/core/consensus.go @@ -314,6 +314,13 @@ func (con *Consensus) Run(initBlock *types.Block) { // Setup context. con.ctx, con.ctxCancel = context.WithCancel(context.Background()) con.ccModule.init(initBlock) + // TODO(jimmy-dexon): change AppendConfig to add config for specific round. + for i := uint64(0); i < initBlock.Position.Round; i++ { + cfg := con.gov.Configuration(i + 1) + if err := con.lattice.AppendConfig(i+1, cfg); err != nil { + panic(err) + } + } go con.processMsg(con.network.ReceiveChan()) con.cfgModule.registerDKG(con.round, int(con.currentConfig.DKGSetSize)/3+1) con.event.RegisterTime(con.dMoment.Add(con.currentConfig.RoundInterval/4), |