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
0cf53d6f
Unverified
Commit
0cf53d6f
authored
Mar 31, 2020
by
Steven Allen
Committed by
GitHub
Mar 31, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #190 from libp2p/fix/189
fix: set teardown after storing the context
parents
3d87dde1
5ec47677
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
swarm.go
swarm.go
+5
-1
No files found.
swarm.go
View file @
0cf53d6f
...
...
@@ -112,9 +112,13 @@ func NewSwarm(ctx context.Context, local peer.ID, peers peerstore.Peerstore, bwc
s
.
dsync
=
NewDialSync
(
s
.
doDial
)
s
.
limiter
=
newDialLimiter
(
s
.
dialAddr
)
s
.
proc
=
goprocessctx
.
WithContext
AndTeardown
(
ctx
,
s
.
teardown
)
s
.
proc
=
goprocessctx
.
WithContext
(
ctx
)
s
.
ctx
=
goprocessctx
.
OnClosingContext
(
s
.
proc
)
// Set teardown after setting the context/process so we don't start the
// teardown process early.
s
.
proc
.
SetTeardown
(
s
.
teardown
)
return
s
}
...
...
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