summaryrefslogtreecommitdiffhomepage
path: root/peer.go
diff options
context:
space:
mode:
authorMathias Hall-Andersen <mathias@hall-andersen.dk>2018-04-18 20:29:48 +0200
committerMathias Hall-Andersen <mathias@hall-andersen.dk>2018-04-18 20:29:48 +0200
commitac9912345b4da5034ea93f5f245ea2ce04815bd5 (patch)
treeb371c03e54c7d1ee2c882fdf596b011a936d2ad7 /peer.go
parent26a56a652eeeece7677ba4f1896da34c83930652 (diff)
Fixed read from closed channel
A premature waitgroup .Done resulted in reading from closed channel. This caused a nil-pointer deref & crash. Added additional debugging when closing routines.
Diffstat (limited to 'peer.go')
-rw-r--r--peer.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/peer.go b/peer.go
index 8acdfbc..f10bfbb 100644
--- a/peer.go
+++ b/peer.go
@@ -246,8 +246,8 @@ func (peer *Peer) Stop() {
// stop & wait for ongoing peer routines
- peer.routines.stop.Broadcast()
peer.routines.starting.Wait()
+ peer.routines.stop.Broadcast()
peer.routines.stopping.Wait()
// stop timers