Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
f728837e
Commit
f728837e
authored
6 years ago
by
Janoš Guljaš
Committed by
Viktor Trón
6 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
swarm/storage: fix mockNetFetcher data races (#18462)
fixes: ethersphere/go-ethereum#1117
parent
96c7c18b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
netstore_test.go
swarm/storage/netstore_test.go
+4
-0
No files found.
swarm/storage/netstore_test.go
View file @
f728837e
...
...
@@ -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
{
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment