aboutsummaryrefslogtreecommitdiffstats
path: root/swarm/storage/netstore_test.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2019-02-20 16:48:12 +0800
committerGitHub <noreply@github.com>2019-02-20 16:48:12 +0800
commitc942700427557e3ff6de3aaf6b916e2f056c1ec2 (patch)
treecadf68e7206d6de42b1eefc6967214cf86e35ff2 /swarm/storage/netstore_test.go
parent7fa3509e2eaf1a4ebc12344590e5699406690f15 (diff)
parentcde35439e058b4f9579830fec9fb65ae0b998346 (diff)
downloadgo-tangerine-1.8.23.tar
go-tangerine-1.8.23.tar.gz
go-tangerine-1.8.23.tar.bz2
go-tangerine-1.8.23.tar.lz
go-tangerine-1.8.23.tar.xz
go-tangerine-1.8.23.tar.zst
go-tangerine-1.8.23.zip
Merge pull request #19029 from holiman/update1.8v1.8.23
Update1.8
Diffstat (limited to 'swarm/storage/netstore_test.go')
-rw-r--r--swarm/storage/netstore_test.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/swarm/storage/netstore_test.go b/swarm/storage/netstore_test.go
index 2ed3e0752..88ec6c28f 100644
--- a/swarm/storage/netstore_test.go
+++ b/swarm/storage/netstore_test.go
@@ -43,14 +43,18 @@ type mockNetFetcher struct {
quit <-chan struct{}
ctx context.Context
hopCounts []uint8
+ mu sync.Mutex
}
-func (m *mockNetFetcher) Offer(ctx context.Context, source *enode.ID) {
+func (m *mockNetFetcher) Offer(source *enode.ID) {
m.offerCalled = true
m.sources = append(m.sources, source)
}
-func (m *mockNetFetcher) Request(ctx context.Context, hopCount uint8) {
+func (m *mockNetFetcher) Request(hopCount uint8) {
+ m.mu.Lock()
+ defer m.mu.Unlock()
+
m.requestCalled = true
var peers []Address
m.peers.Range(func(key interface{}, _ interface{}) bool {