We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f539ed1 commit 3630432Copy full SHA for 3630432
p2p/discover/table.go
@@ -278,12 +278,16 @@ func (tab *Table) refresh() {
278
for _, seed := range seeds {
279
glog.V(logger.Debug).Infoln("Seeding network with", seed)
280
}
281
+ peers := append(tab.nursery, seeds...)
282
+
283
// Bootstrap the table with a self lookup
- all := tab.bondall(append(tab.nursery, seeds...))
- tab.mutex.Lock()
284
- tab.add(all)
285
- tab.mutex.Unlock()
286
- tab.Lookup(tab.self.ID)
+ if len(peers) > 0 {
+ tab.mutex.Lock()
+ tab.add(peers)
287
+ tab.mutex.Unlock()
288
289
+ tab.Lookup(tab.self.ID)
290
+ }
291
// TODO: the Kademlia paper says that we're supposed to perform
292
// random lookups in all buckets further away than our closest neighbor.
293
0 commit comments