diff options
author | Jimmy Hu <jimmy.hu@dexon.org> | 2019-03-13 18:19:53 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@byzantine-lab.io> | 2019-06-12 17:27:22 +0800 |
commit | 43457d6a008524f9dd353fce7b12e16cd4d0e157 (patch) | |
tree | 12782a2db49a1ee4e1fa97db64901251eeed36af /vendor/github.com/dexon-foundation/dexon-consensus/core/consensus.go | |
parent | a0684dc255fb2d3db22ea4c03957d9b7b27a0a36 (diff) | |
download | go-tangerine-43457d6a008524f9dd353fce7b12e16cd4d0e157.tar.gz go-tangerine-43457d6a008524f9dd353fce7b12e16cd4d0e157.tar.zst go-tangerine-43457d6a008524f9dd353fce7b12e16cd4d0e157.zip |
vendor: sync to latest core (#253)
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) + } }() }) } |