summaryrefslogtreecommitdiffhomepage
path: root/device.go
diff options
context:
space:
mode:
Diffstat (limited to 'device.go')
-rw-r--r--device.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/device.go b/device.go
index 7cf9ba2..8823404 100644
--- a/device.go
+++ b/device.go
@@ -377,10 +377,11 @@ func (device *Device) Close() {
close(device.signals.stop)
+ device.RemoveAllPeers()
+
device.state.stopping.Wait()
device.FlushPacketQueues()
- device.RemoveAllPeers()
device.rate.limiter.Close()
device.state.changing.Set(false)