From 03ba13fcf85ab60d1a76283402ccd6ea53eda464 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Sat, 11 Nov 2017 14:59:49 -0800 Subject: [PATCH] lnwallet: ensure sigPool goroutines can always exit --- lnwallet/sigpool.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lnwallet/sigpool.go b/lnwallet/sigpool.go index bc0c659e..2354ca4e 100644 --- a/lnwallet/sigpool.go +++ b/lnwallet/sigpool.go @@ -191,6 +191,8 @@ func (s *sigPool) poolWorker() { continue case <-sigMsg.cancel: continue + case <-s.quit: + return } } @@ -202,6 +204,8 @@ func (s *sigPool) poolWorker() { }: case <-sigMsg.cancel: continue + case <-s.quit: + return } // We've just received a new verification job from the outside @@ -226,11 +230,15 @@ func (s *sigPool) poolWorker() { select { case verifyMsg.errResp <- err: case <-verifyMsg.cancel: + case <-s.quit: + return } } else { select { case verifyMsg.errResp <- nil: case <-verifyMsg.cancel: + case <-s.quit: + return } }