diff options
author | Mission Liao <mission.liao@dexon.org> | 2019-03-22 20:20:52 +0800 |
---|---|---|
committer | Jimmy Hu <jimmy.hu@dexon.org> | 2019-03-22 20:20:52 +0800 |
commit | 0f2dd4260fd98b2be06b7f9b0197134c89f11d3c (patch) | |
tree | 49203e7f865fc823c0a51d88da27c3ff05656357 /core/consensus_test.go | |
parent | 99723721b79e7f1cf5d1009d9117705d84df5eaa (diff) | |
download | dexon-consensus-0f2dd4260fd98b2be06b7f9b0197134c89f11d3c.tar dexon-consensus-0f2dd4260fd98b2be06b7f9b0197134c89f11d3c.tar.gz dexon-consensus-0f2dd4260fd98b2be06b7f9b0197134c89f11d3c.tar.bz2 dexon-consensus-0f2dd4260fd98b2be06b7f9b0197134c89f11d3c.tar.lz dexon-consensus-0f2dd4260fd98b2be06b7f9b0197134c89f11d3c.tar.xz dexon-consensus-0f2dd4260fd98b2be06b7f9b0197134c89f11d3c.tar.zst dexon-consensus-0f2dd4260fd98b2be06b7f9b0197134c89f11d3c.zip |
core: abort hang DKG (#508)
* Capitalize log
* Fix DKG aborting hangs
Make sure reset cc.dkg to nil in runDKG
* Remember to purge tsig verfier too
* Replace abortCh with context.Context
* Fix obvious bug
* Fixup: forever blockin at Wait method when runDKG is not called
* Fixup: fix corner case
If the Add(1) moved to runDKG under cc.dkgLock,
we may not catch it after unlocking cc.dkgLock.
* fixup
Diffstat (limited to 'core/consensus_test.go')
-rw-r--r-- | core/consensus_test.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/consensus_test.go b/core/consensus_test.go index 2a5cc54..230921c 100644 --- a/core/consensus_test.go +++ b/core/consensus_test.go @@ -235,11 +235,11 @@ func (s *ConsensusTestSuite) TestRegisteredDKGRecover() { s.Require().Nil(con.cfgModule.dkg) - con.cfgModule.registerDKG(0, 0, 10) + con.cfgModule.registerDKG(con.ctx, 0, 0, 10) _, newCon := s.prepareConsensusWithDB(dMoment, gov, prvKeys[0], conn, dbInst) - newCon.cfgModule.registerDKG(0, 0, 10) + newCon.cfgModule.registerDKG(newCon.ctx, 0, 0, 10) s.Require().NotNil(newCon.cfgModule.dkg) s.Require().True(newCon.cfgModule.dkg.prvShares.Equal(con.cfgModule.dkg.prvShares)) |