Skip to content
This repository has been archived by the owner on Sep 9, 2022. It is now read-only.

return the full address from conn.RemoteMultiaddr #80

Merged
merged 3 commits into from
Sep 18, 2019

Conversation

Stebalien
Copy link
Member

@Stebalien Stebalien commented Sep 18, 2019

I can't think of a good reason not to do this (see libp2p/go-libp2p#723). I thought there was one but I can't remember what it was.

This also changes how we parse addresses to use ma.SplitFunc, avoiding some allocations.

@vyzo
Copy link
Contributor

vyzo commented Sep 18, 2019

test failure:

panic: multiaddr failed to parse: no protocol with code 290

Copy link
Contributor

@vyzo vyzo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but there is a panic in the tests.

Use ma.SplitFunc instead of splitting the entire multiaddr and comparing bytes.
This avoids a bunch of unnecessary allocation and copying.
There's no reason _not_ to do this.
@Stebalien Stebalien merged commit ff52b70 into master Sep 18, 2019
@Stebalien Stebalien deleted the feat/addr-handling branch September 18, 2019 17:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants