good morning!!!!

Skip to content
Snippets Groups Projects
Commit f728837e authored by Janoš Guljaš's avatar Janoš Guljaš Committed by Viktor Trón
Browse files

swarm/storage: fix mockNetFetcher data races (#18462)

fixes: ethersphere/go-ethereum#1117
parent 96c7c18b
No related branches found
No related tags found
No related merge requests found
......@@ -43,6 +43,7 @@ type mockNetFetcher struct {
quit <-chan struct{}
ctx context.Context
hopCounts []uint8
mu sync.Mutex
}
func (m *mockNetFetcher) Offer(ctx context.Context, source *enode.ID) {
......@@ -51,6 +52,9 @@ func (m *mockNetFetcher) Offer(ctx context.Context, source *enode.ID) {
}
func (m *mockNetFetcher) Request(ctx context.Context, hopCount uint8) {
m.mu.Lock()
defer m.mu.Unlock()
m.requestCalled = true
var peers []Address
m.peers.Range(func(key interface{}, _ interface{}) bool {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment