don't wrap conns with metrics if bwc is nil
This commit is contained in:
parent
ab39c6f524
commit
9a9a8de2c7
|
@ -109,8 +109,11 @@ func NewSwarm(ctx context.Context, listenAddrs []ma.Multiaddr,
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
wrap := func(c transport.Conn) transport.Conn {
|
var wrap func(c transport.Conn) transport.Conn
|
||||||
return mconn.WrapConn(bwc, c)
|
if bwc != nil {
|
||||||
|
wrap = func(c transport.Conn) transport.Conn {
|
||||||
|
return mconn.WrapConn(bwc, c)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
s := &Swarm{
|
s := &Swarm{
|
||||||
|
|
Loading…
Reference in New Issue