diff options
author | Jimmy Hu <jimmy.hu@dexon.org> | 2019-03-17 22:52:40 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@byzantine-lab.io> | 2019-06-12 17:27:23 +0800 |
commit | 76d5bfcaf0a4c816842b561e3b3b995c1e766d1f (patch) | |
tree | 7eaee3fe61da79f7916ee1b654e5a6a6bab01e5c /vendor/github.com/dexon-foundation/dexon-consensus/core/consensus.go | |
parent | 6d4dd6853393014e6a355995dd91ecefd7a3095d (diff) | |
download | go-tangerine-76d5bfcaf0a4c816842b561e3b3b995c1e766d1f.tar go-tangerine-76d5bfcaf0a4c816842b561e3b3b995c1e766d1f.tar.gz go-tangerine-76d5bfcaf0a4c816842b561e3b3b995c1e766d1f.tar.bz2 go-tangerine-76d5bfcaf0a4c816842b561e3b3b995c1e766d1f.tar.lz go-tangerine-76d5bfcaf0a4c816842b561e3b3b995c1e766d1f.tar.xz go-tangerine-76d5bfcaf0a4c816842b561e3b3b995c1e766d1f.tar.zst go-tangerine-76d5bfcaf0a4c816842b561e3b3b995c1e766d1f.zip |
core: check reset of dkg types when adding (#268)
* vendor: sync to latest core
* core: check dkg reset
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 | 11 |
1 files changed, 5 insertions, 6 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 8529e4031..e0a6753a9 100644 --- a/vendor/github.com/dexon-foundation/dexon-consensus/core/consensus.go +++ b/vendor/github.com/dexon-foundation/dexon-consensus/core/consensus.go @@ -740,7 +740,7 @@ func (con *Consensus) prepare( con.logger.Info("Selected as DKG set", "round", nextRound) nextConfig := utils.GetConfigWithPanic(con.gov, nextRound, con.logger) - con.cfgModule.registerDKG(nextRound, utils.GetDKGThreshold( + con.cfgModule.registerDKG(nextRound, e.Reset, utils.GetDKGThreshold( nextConfig)) con.event.RegisterHeight(e.NextDKGPreparationHeight(), func(uint64) { @@ -749,7 +749,7 @@ func (con *Consensus) prepare( defer con.dkgReady.L.Unlock() con.dkgRunning = 0 }() - con.runDKG(nextRound, nextConfig) + con.runDKG(nextRound, e.Reset, nextConfig) }) }) }) @@ -805,7 +805,7 @@ func (con *Consensus) Run() { } // runDKG starts running DKG protocol. -func (con *Consensus) runDKG(round uint64, config *types.Config) { +func (con *Consensus) runDKG(round, reset uint64, config *types.Config) { con.dkgReady.L.Lock() defer con.dkgReady.L.Unlock() if con.dkgRunning != 0 { @@ -819,7 +819,7 @@ func (con *Consensus) runDKG(round uint64, config *types.Config) { con.dkgReady.Broadcast() con.dkgRunning = 2 }() - if err := con.cfgModule.runDKG(round); err != nil { + if err := con.cfgModule.runDKG(round, reset); err != nil { con.logger.Error("Failed to runDKG", "error", err) } }() @@ -841,8 +841,7 @@ func (con *Consensus) runCRS(round uint64, hash common.Hash) { "hash", psig.Hash) con.network.BroadcastDKGPartialSignature(psig) con.logger.Debug("Calling Governance.CRS", "round", round) - crs, err := con.cfgModule.runCRSTSig( - round, utils.GetCRSWithPanic(con.gov, round, con.logger)) + crs, err := con.cfgModule.runCRSTSig(round, hash) if err != nil { con.logger.Error("Failed to run CRS Tsig", "error", err) } else { |