Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
go-libp2p
Commits
9a9a8de2
Commit
9a9a8de2
authored
Sep 04, 2016
by
Jeromy
Browse files
don't wrap conns with metrics if bwc is nil
parent
ab39c6f5
Changes
1
Show whitespace changes
Inline
Side-by-side
p2p/net/swarm/swarm.go
View file @
9a9a8de2
...
...
@@ -109,9 +109,12 @@ func NewSwarm(ctx context.Context, listenAddrs []ma.Multiaddr,
return
nil
,
err
}
wrap
:=
func
(
c
transport
.
Conn
)
transport
.
Conn
{
var
wrap
func
(
c
transport
.
Conn
)
transport
.
Conn
if
bwc
!=
nil
{
wrap
=
func
(
c
transport
.
Conn
)
transport
.
Conn
{
return
mconn
.
WrapConn
(
bwc
,
c
)
}
}
s
:=
&
Swarm
{
swarm
:
ps
.
NewSwarm
(
PSTransport
),
...
...
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