Skip to content

Commit 1ecd4cf

Browse files
fix: use correct mutex for reading keyToPeerMap (#1086)
1 parent 298f22a commit 1ecd4cf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fullrt/dht.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,9 +292,9 @@ func (dht *FullRT) Ready() bool {
292292

293293
// TODO: This function needs to be better defined. Perhaps based on going through the peer map and seeing when the
294294
// last time we were connected to any of them was.
295-
dht.peerAddrsLk.RLock()
295+
dht.kMapLk.RLock()
296296
rtSize := len(dht.keyToPeerMap)
297-
dht.peerAddrsLk.RUnlock()
297+
dht.kMapLk.RUnlock()
298298

299299
return rtSize > len(dht.bootstrapPeers)+1
300300
}

0 commit comments

Comments
 (0)