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.
This commit is contained in:
parent
26a56a652e
commit
ac9912345b
4 changed files with 26 additions and 10 deletions
2
peer.go
2
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue