dht: removing addrs sanity check
About to allow dht to start without local addresses. this is so that we can initialize the dht and sign it up to listen on the muxer, before our node starts accepting incoming connections. otherwise, we lose some (we're observing this happening already). I looked through the dht's use of the peerstore, and the check here doesnt seem to be as important as the panic implies. I believe the panic was used for debugging weird "dont have any address" conditions we had earlier.
Juan Batiz-Benet committed
Jan 30, 2015 at 20:19 UTC
d0432f9e75b6bad6c3d496de95496f31851fe8b9
1 file changed
-5
routing/dht/dht.go
-5
@@ -76,11 +76,6 @@ func NewDHT(ctx context.Context, h host.Host, dstore ds.ThreadSafeDatastore) *Ip
76
return nil
77
})
78
79
- // sanity check. this should **never** happen
80
- if len(dht.peerstore.Addresses(dht.self)) < 1 {
81
- panic("attempt to initialize dht without addresses for self")
82
- }
83
-
79
h.SetStreamHandler(ProtocolDHT, dht.handleNewStream)
80
dht.providers = NewProviderManager(dht.Context(), dht.self)
81
dht.AddChildGroup(dht.providers)