aboutsummaryrefslogtreecommitdiffstats
path: root/core/blockchain.go
diff options
context:
space:
mode:
authorMission Liao <mission.liao@dexon.org>2019-03-22 20:20:52 +0800
committerJimmy Hu <jimmy.hu@dexon.org>2019-03-22 20:20:52 +0800
commit0f2dd4260fd98b2be06b7f9b0197134c89f11d3c (patch)
tree49203e7f865fc823c0a51d88da27c3ff05656357 /core/blockchain.go
parent99723721b79e7f1cf5d1009d9117705d84df5eaa (diff)
downloadtangerine-consensus-0f2dd4260fd98b2be06b7f9b0197134c89f11d3c.tar
tangerine-consensus-0f2dd4260fd98b2be06b7f9b0197134c89f11d3c.tar.gz
tangerine-consensus-0f2dd4260fd98b2be06b7f9b0197134c89f11d3c.tar.bz2
tangerine-consensus-0f2dd4260fd98b2be06b7f9b0197134c89f11d3c.tar.lz
tangerine-consensus-0f2dd4260fd98b2be06b7f9b0197134c89f11d3c.tar.xz
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.go4
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 {