diff options
author | wmin0 <wmin0@hotmail.com> | 2019-01-03 23:38:09 +0800 |
---|---|---|
committer | Jimmy Hu <jimmy.hu@dexon.org> | 2019-01-03 23:38:09 +0800 |
commit | 4757fa14e9832b7eb0502470d47c0e70f7d10379 (patch) | |
tree | c33bd831cb3c1196e298375e79412406b161b141 | |
parent | 09a00a0580c2fd6e11b17f1793edca5f7bb2f5f8 (diff) | |
download | dexon-consensus-4757fa14e9832b7eb0502470d47c0e70f7d10379.tar dexon-consensus-4757fa14e9832b7eb0502470d47c0e70f7d10379.tar.gz dexon-consensus-4757fa14e9832b7eb0502470d47c0e70f7d10379.tar.bz2 dexon-consensus-4757fa14e9832b7eb0502470d47c0e70f7d10379.tar.lz dexon-consensus-4757fa14e9832b7eb0502470d47c0e70f7d10379.tar.xz dexon-consensus-4757fa14e9832b7eb0502470d47c0e70f7d10379.tar.zst dexon-consensus-4757fa14e9832b7eb0502470d47c0e70f7d10379.zip |
core: stop leaking timer (#394)
-rw-r--r-- | core/configuration-chain.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/core/configuration-chain.go b/core/configuration-chain.go index 5c389a7..a4636cb 100644 --- a/core/configuration-chain.go +++ b/core/configuration-chain.go @@ -107,6 +107,7 @@ func (cc *configurationChain) registerDKG(round uint64, threshold int) { threshold) go func() { ticker := newTicker(cc.gov, round, TickerDKG) + defer ticker.Stop() <-ticker.Tick() cc.dkgLock.Lock() defer cc.dkgLock.Unlock() @@ -142,6 +143,7 @@ func (cc *configurationChain) runDKG(round uint64) error { cc.dkgLock.Lock() } ticker := newTicker(cc.gov, round, TickerDKG) + defer ticker.Stop() cc.dkgLock.Unlock() <-ticker.Tick() cc.dkgLock.Lock() |