Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
p2p
go-p2p-swarm
Commits
a8a20986
Commit
a8a20986
authored
Aug 30, 2017
by
Steven Allen
Committed by
GitHub
Aug 30, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #33 from libp2p/fix/100
test: connect each peer precisely once.
parents
9b117d88
8f45dbfd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
6 deletions
+4
-6
swarm_test.go
swarm_test.go
+4
-6
No files found.
swarm_test.go
View file @
a8a20986
...
...
@@ -102,12 +102,10 @@ func connectSwarms(t *testing.T, ctx context.Context, swarms []*Swarm) {
}
log
.
Info
(
"Connecting swarms simultaneously."
)
for
_
,
s1
:=
range
swarms
{
for
_
,
s2
:=
range
swarms
{
if
s2
.
local
!=
s1
.
local
{
// don't connect to self.
wg
.
Add
(
1
)
connect
(
s1
,
s2
.
LocalPeer
(),
s2
.
ListenAddresses
()[
0
])
// try the first.
}
for
i
,
s1
:=
range
swarms
{
for
_
,
s2
:=
range
swarms
[
i
+
1
:
]
{
wg
.
Add
(
1
)
connect
(
s1
,
s2
.
LocalPeer
(),
s2
.
ListenAddresses
()[
0
])
// try the first.
}
}
wg
.
Wait
()
...
...
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