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/blockchain.go | |
parent | 99723721b79e7f1cf5d1009d9117705d84df5eaa (diff) | |
download | tangerine-consensus-0f2dd4260fd98b2be06b7f9b0197134c89f11d3c.tar.gz tangerine-consensus-0f2dd4260fd98b2be06b7f9b0197134c89f11d3c.tar.zst tangerine-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/blockchain.go')
-rw-r--r-- | core/blockchain.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/core/blockchain.go b/core/blockchain.go index c5a22b6..610ab28 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -122,6 +122,7 @@ func newBlockChainConfig(prev blockChainConfig, config *types.Config) ( type tsigVerifierGetter interface { UpdateAndGet(uint64) (TSigVerifier, bool, error) + Purge(uint64) } type blockChain struct { @@ -196,6 +197,9 @@ func (bc *blockChain) notifyRoundEvents(evts []utils.RoundEventParam) error { } bc.configs = append(bc.configs, c) } + if e.Reset != 0 { + bc.vGetter.Purge(e.Round + 1) + } return nil } for _, e := range evts { |