Commit 0cf68a57 authored by vyzo's avatar vyzo

treat transient conns as opt-in for opening new streams

parent 746f908d
......@@ -351,6 +351,13 @@ func (s *Swarm) NewStream(ctx context.Context, p peer.ID) (network.Stream, error
return nil, err
}
}
if c.Stat().Transient {
if !network.GetUseTransient(ctx) {
return nil, network.ErrTransientConn
}
}
s, err := c.NewStream(ctx)
if err != nil {
if c.conn.IsClosed() {
......
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