Skip to content

Commit

Permalink
storagenode/trust: fix data race
Browse files Browse the repository at this point in the history
Change-Id: Ia821a238c90ffb5f3abdc8042aff1b75cfc74ce4
  • Loading branch information
profclems committed Apr 19, 2024
1 parent 71fed1a commit f91819e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions storagenode/trust/service.go
Expand Up @@ -159,9 +159,13 @@ func (pool *Pool) GetSignee(ctx context.Context, id storj.NodeID) (_ signing.Sig
// GetSatellites returns a slice containing all trusted satellites.
func (pool *Pool) GetSatellites(ctx context.Context) (satellites []storj.NodeID) {
defer mon.Task()(&ctx)(nil)

pool.satellitesMu.RLock()
for sat := range pool.satellites {
satellites = append(satellites, sat)
}
pool.satellitesMu.RUnlock()

sort.Sort(storj.NodeIDList(satellites))
return satellites
}
Expand Down

0 comments on commit f91819e

Please sign in to comment.