From 4757fa14e9832b7eb0502470d47c0e70f7d10379 Mon Sep 17 00:00:00 2001 From: wmin0 Date: Thu, 3 Jan 2019 23:38:09 +0800 Subject: core: stop leaking timer (#394) --- core/configuration-chain.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'core') 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() -- cgit v1.2.3