Skip to content

Commit

Permalink
review suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
walldiss committed Apr 19, 2023
1 parent 02f9eb1 commit 8ae29dc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions share/p2p/peers/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const defaultCleanupThreshold = 2

// pool stores peers and provides methods for simple round-robin access.
type pool struct {
m sync.Mutex
m sync.RWMutex
peersList []peer.ID
statuses map[peer.ID]status
cooldown *timedQueue
Expand Down Expand Up @@ -196,7 +196,7 @@ func (p *pool) checkHasPeers() {
}

func (p *pool) size() int {
p.m.Lock()
defer p.m.Unlock()
p.m.RLock()
defer p.m.RUnlock()
return p.activeCount
}
2 changes: 1 addition & 1 deletion share/p2p/shrexnd/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func (c *Client) RequestND(
}
}
if err != p2p.ErrNotFound {
log.Warnw("client: peer returned err", "err", err)
log.Warnw("client-nd: peer returned err", "err", err)
}
return nil, err
}
Expand Down

0 comments on commit 8ae29dc

Please sign in to comment.