multi: move several wait group done calls to defer statements
This commit is contained in:
1 parent
27849d3020
commit
10d94f99c0
5 files changed
+10
-6
No files matched your search
@@ -781,6 +781,8 @@ func (t *txSubscriptionClient) Cancel() {
|
||||
// wallet's notification client to a higher-level TransactionSubscription
|
||||
// client.
|
||||
func (t *txSubscriptionClient) notificationProxier() {
|
||||
defer t.wg.Done()
|
||||
|
||||
out:
|
||||
for {
|
||||
select {
|
||||
@@ -830,8 +832,6 @@ out:
|
||||
break out
|
||||
}
|
||||
}
|
||||
|
||||
t.wg.Done()
|
||||
}
|
||||
|
||||
// SubscribeTransactions returns a TransactionSubscription client which
|
||||
|
||||
+2
-2
@@ -425,6 +425,8 @@ func (l *LightningWallet) ActiveReservations() []*ChannelReservation {
|
||||
// requestHandler is the primary goroutine(s) responsible for handling, and
|
||||
// dispatching replies to all messages.
|
||||
func (l *LightningWallet) requestHandler() {
|
||||
defer l.wg.Done()
|
||||
|
||||
out:
|
||||
for {
|
||||
select {
|
||||
@@ -450,8 +452,6 @@ out:
|
||||
break out
|
||||
}
|
||||
}
|
||||
|
||||
l.wg.Done()
|
||||
}
|
||||
|
||||
// InitChannelReservation kicks off the 3-step workflow required to successfully
|
||||
|
||||
Reference in new issue
Block a user