diff --git a/beacon-chain/sync/peerstatus/peer_statuses.go b/beacon-chain/sync/peerstatus/peer_statuses.go index b9573f113..c0fae8865 100644 --- a/beacon-chain/sync/peerstatus/peer_statuses.go +++ b/beacon-chain/sync/peerstatus/peer_statuses.go @@ -35,6 +35,8 @@ func Delete(pid peer.ID) { // Count of peer statuses in cache. Threadsafe. func Count() int { + lock.RLock() + defer lock.RUnlock() return len(peerStatuses) }