utxonursery: check for quit channel
This commit is contained in:
parent
8b515f83b3
commit
77d6a6697d
@ -359,6 +359,14 @@ func (u *utxoNursery) IncubateOutputs(chanPoint wire.OutPoint,
|
|||||||
u.wg.Add(1)
|
u.wg.Add(1)
|
||||||
defer u.wg.Done()
|
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)
|
numHtlcs := len(incomingHtlcs) + len(outgoingHtlcs)
|
||||||
var (
|
var (
|
||||||
hasCommit bool
|
hasCommit bool
|
||||||
|
Loading…
Reference in New Issue
Block a user