Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
p2p
go-p2p-swarm
Commits
df0ab8b9
Commit
df0ab8b9
authored
Apr 01, 2021
by
vyzo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make addr utility funcs standalone and not exported
parent
be3e9404
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
swarm_dial.go
swarm_dial.go
+4
-4
No files found.
swarm_dial.go
View file @
df0ab8b9
...
...
@@ -621,10 +621,10 @@ func (s *Swarm) nonProxyAddr(addr ma.Multiaddr) bool {
// UDP > TCP
func
(
s
*
Swarm
)
rankAddrs
(
addrs
[]
ma
.
Multiaddr
)
[]
ma
.
Multiaddr
{
addrTier
:=
func
(
a
ma
.
Multiaddr
)
(
tier
int
)
{
if
s
.
I
sRelayAddr
(
a
)
{
if
i
sRelayAddr
(
a
)
{
tier
|=
0
b1000
}
if
s
.
I
sExpensiveAddr
(
a
)
{
if
i
sExpensiveAddr
(
a
)
{
tier
|=
0
b0100
}
if
!
manet
.
IsPrivateAddr
(
a
)
{
...
...
@@ -741,13 +741,13 @@ func (s *Swarm) IsFdConsumingAddr(addr ma.Multiaddr) bool {
return
err1
==
nil
||
err2
==
nil
}
func
(
s
*
Swarm
)
I
sExpensiveAddr
(
addr
ma
.
Multiaddr
)
bool
{
func
i
sExpensiveAddr
(
addr
ma
.
Multiaddr
)
bool
{
_
,
err1
:=
addr
.
ValueForProtocol
(
ma
.
P_WS
)
_
,
err2
:=
addr
.
ValueForProtocol
(
ma
.
P_WSS
)
return
err1
==
nil
||
err2
==
nil
}
func
(
s
*
Swarm
)
I
sRelayAddr
(
addr
ma
.
Multiaddr
)
bool
{
func
i
sRelayAddr
(
addr
ma
.
Multiaddr
)
bool
{
_
,
err
:=
addr
.
ValueForProtocol
(
ma
.
P_CIRCUIT
)
return
err
==
nil
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment