lnwallet: ensure sigPool goroutines can always exit

This commit is contained in:
Olaoluwa Osuntokun 2017-11-11 14:59:49 -08:00
parent 8c181b6f4e
commit 03ba13fcf8
No known key found for this signature in database
GPG Key ID: 964EA263DD637C21

@ -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
}
}