diff options
Diffstat (limited to 'vendor/github.com/dexon-foundation/dexon-consensus/core/consensus.go')
-rw-r--r-- | vendor/github.com/dexon-foundation/dexon-consensus/core/consensus.go | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/vendor/github.com/dexon-foundation/dexon-consensus/core/consensus.go b/vendor/github.com/dexon-foundation/dexon-consensus/core/consensus.go index ccb332684..4201cbcc2 100644 --- a/vendor/github.com/dexon-foundation/dexon-consensus/core/consensus.go +++ b/vendor/github.com/dexon-foundation/dexon-consensus/core/consensus.go @@ -538,6 +538,11 @@ func newConsensusForRound( logger: logger, } cfgModule := newConfigurationChain(ID, recv, gov, nodeSetCache, db, logger) + dkg, err := recoverDKGProtocol(ID, recv, initRound, utils.GetDKGThreshold(initConfig), db) + if err != nil { + panic(err) + } + cfgModule.dkg = dkg recv.cfgModule = cfgModule appModule := app if usingNonBlocking { @@ -545,7 +550,7 @@ func newConsensusForRound( } bcConfig := blockChainConfig{} bcConfig.fromConfig(initRound, initConfig) - bcConfig.setRoundBeginHeight(initRoundBeginHeight) + bcConfig.SetRoundBeginHeight(initRoundBeginHeight) bcModule := newBlockChain(ID, dMoment, initBlock, bcConfig, appModule, NewTSigVerifierCache(gov, 7), signer, logger) // Construct Consensus instance. @@ -573,8 +578,7 @@ func newConsensusForRound( con.ctx, con.ctxCancel = context.WithCancel(context.Background()) baConfig := agreementMgrConfig{} baConfig.from(initRound, initConfig, initCRS) - baConfig.setRoundBeginHeight(initRoundBeginHeight) - var err error + baConfig.SetRoundBeginHeight(initRoundBeginHeight) con.baMgr, err = newAgreementMgr(con, initRound, baConfig) if err != nil { panic(err) @@ -845,6 +849,10 @@ func (con *Consensus) initialRound( con.logger.Warn("Failed to update nodeSetCache", "round", round+1, "error", err) } + if _, _, err := con.bcModule.vGetter.UpdateAndGet(round + 1); err != nil { + con.logger.Warn("Failed to update tsigVerifierCache", + "round", round+1, "error", err) + } }() }) } |