utxonursery: check for quit channel

This commit is contained in:
Joost Jager 2018-09-24 20:40:23 -07:00
parent 8b515f83b3
commit 77d6a6697d
No known key found for this signature in database
GPG Key ID: AE6B0D042C8E38D9

View File

@ -359,6 +359,14 @@ func (u *utxoNursery) IncubateOutputs(chanPoint wire.OutPoint,
u.wg.Add(1)
defer u.wg.Done()
// Check quit channel for the case where the waitgroup wait was finished
// right before this function's add call was made.
select {
case <-u.quit:
return fmt.Errorf("nursery shutting down")
default:
}
numHtlcs := len(incomingHtlcs) + len(outgoingHtlcs)
var (
hasCommit bool