htlcswitch/switch: remove unnecessary defer closure

This commit is contained in:
Conner Fromknecht committed 2018-08-18 20:19:17 -07:00
1 parent 9047eee2f1
commit 48b616629a
1 file changed
+1 -3
+1 -3
View File
@@ -690,9 +690,7 @@ func (s *Switch) ForwardPackets(linkQuit chan struct{},
func (s *Switch) proxyFwdErrs(num *int, wg *sync.WaitGroup,
fwdChan, errChan chan error) {
defer s.wg.Done()
defer func() {
close(errChan)
}()
defer close(errChan)
// Wait here until the outer function has finished persisting
// and routing the packets. This guarantees we don't read from num until