We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 75538ef commit 6fa87f6Copy full SHA for 6fa87f6
p2p/net/swarm/swarm_transport.go
@@ -13,6 +13,9 @@ import (
13
// TransportForDialing retrieves the appropriate transport for dialing the given
14
// multiaddr.
15
func (s *Swarm) TransportForDialing(a ma.Multiaddr) transport.Transport {
16
+ if a == nil {
17
+ return nil
18
+ }
19
protocols := a.Protocols()
20
if len(protocols) == 0 {
21
return nil
@@ -34,6 +37,9 @@ func (s *Swarm) TransportForDialing(a ma.Multiaddr) transport.Transport {
34
37
if id, _ := peer.IDFromP2PAddr(a); id != "" {
35
38
// This addr has a p2p component. Drop it so we can check transport.
36
39
a, _ = ma.SplitLast(a)
40
41
42
43
}
44
for _, t := range s.transports.m {
45
if t.CanDial(a) {
0 commit comments