From 1e75d6d73f886e9ab5b606f5d448fc9e3b99f676 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Kripalani?= Date: Wed, 26 Jun 2019 17:28:06 +0200 Subject: [PATCH] close the subscription on shutdown. --- dht.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dht.go b/dht.go index be462d3a5..3295d8b15 100644 --- a/dht.go +++ b/dht.go @@ -107,6 +107,9 @@ func New(ctx context.Context, h host.Host, options ...opts.Option) (*IpfsDHT, er // remove ourselves from network notifs. dht.host.Network().StopNotify((*subscriberNotifee)(dht)) + if dht.subscriptions.evtPeerIdentification != nil { + _ = dht.subscriptions.evtPeerIdentification.Close() + } return nil })