don't wrap conns with metrics if bwc is nil
This commit is contained in:
parent
ab39c6f524
commit
9a9a8de2c7
|
@ -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),
|
||||
|
|
Loading…
Reference in New Issue