From 48b616629a2f004d5aa11e862bf7caccc4b33d31 Mon Sep 17 00:00:00 2001 From: Conner Fromknecht Date: Fri, 27 Jul 2018 03:47:15 -0700 Subject: [PATCH] htlcswitch/switch: remove unnecessary defer closure --- htlcswitch/switch.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/htlcswitch/switch.go b/htlcswitch/switch.go index 8131f90e..74d7f568 100644 --- a/htlcswitch/switch.go +++ b/htlcswitch/switch.go @@ -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