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 })