Commit 48ef0bb9 authored by Jeromy's avatar Jeromy

don't wrap conns with metrics if bwc is nil

parent 880d0c04
......@@ -109,8 +109,11 @@ func NewSwarm(ctx context.Context, listenAddrs []ma.Multiaddr,
return nil, err
}
wrap := func(c transport.Conn) transport.Conn {
return mconn.WrapConn(bwc, c)
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{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment