Skip to content

Commit 298f22a

Browse files
fix: fullrt kMapLk unlock (#1085)
1 parent 010ef38 commit 298f22a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fullrt/dht.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,11 +496,12 @@ func (dht *FullRT) GetClosestPeers(ctx context.Context, key string) ([]peer.ID,
496496
dht.kMapLk.RLock()
497497
// Recover the peer ID from the key
498498
p, ok := dht.keyToPeerMap[string(k)]
499+
dht.kMapLk.RUnlock()
499500
if !ok {
500501
logger.Errorf("key not found in map")
501502
continue
502503
}
503-
dht.kMapLk.RUnlock()
504+
504505
dht.peerAddrsLk.RLock()
505506
peerAddrs := dht.peerAddrs[p]
506507
dht.peerAddrsLk.RUnlock()

0 commit comments

Comments
 (0)