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/dkg-tsig-protocol_test.go | |
parent | 99723721b79e7f1cf5d1009d9117705d84df5eaa (diff) | |
download | dexon-consensus-0f2dd4260fd98b2be06b7f9b0197134c89f11d3c.tar.gz 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/dkg-tsig-protocol_test.go')
-rw-r--r-- | core/dkg-tsig-protocol_test.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/core/dkg-tsig-protocol_test.go b/core/dkg-tsig-protocol_test.go index 9de2027..584b3bb 100644 --- a/core/dkg-tsig-protocol_test.go +++ b/core/dkg-tsig-protocol_test.go @@ -955,6 +955,9 @@ func (s *DKGTSIGProtocolTestSuite) TestTSigVerifierCache() { s.Require().True(ok) s.Equal(uint64(5), cache.minRound) + cache.Purge(5) + s.Require().Len(cache.verifier, 0) + s.Require().Equal(uint64(5), cache.minRound) } func (s *DKGTSIGProtocolTestSuite) TestUnexpectedDKGResetCount() { |