Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
go-libp2p
Commits
e0c5c22d
Commit
e0c5c22d
authored
Aug 06, 2017
by
Lars Gierth
Browse files
Avoid unneccessary multiaddr resolutions
parent
0c23c968
Changes
1
Hide whitespace changes
Inline
Side-by-side
p2p/host/basic/basic_host.go
View file @
e0c5c22d
...
...
@@ -452,6 +452,9 @@ func (h *BasicHost) resolveAddrs(ctx context.Context, pi pstore.PeerInfo) ([]ma.
var
addrs
[]
ma
.
Multiaddr
for
_
,
addr
:=
range
pi
.
Addrs
{
addrs
=
append
(
addrs
,
addr
)
if
!
madns
.
Matches
(
addr
)
{
continue
}
reqaddr
:=
addr
.
Encapsulate
(
p2paddr
)
resaddrs
,
err
:=
h
.
maResolver
.
Resolve
(
ctx
,
reqaddr
)
...
...
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