Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

p2p: fix logging peer address #2773

Closed
ebuchman opened this issue Nov 7, 2018 · 1 comment
Closed

p2p: fix logging peer address #2773

ebuchman opened this issue Nov 7, 2018 · 1 comment
Labels
C:p2p Component: P2P pkg good first issue Contributions Welcome!! T:bug Type Bug (Confirmed)
Milestone

Comments

@ebuchman
Copy link
Contributor

ebuchman commented Nov 7, 2018

Pointed out in #2721 (comment)

module=p2p peer=0xb78f00

It's because we're passing a function pointer rather than calling the function in:

p.SetLogger(sw.Logger.With("peer", p.NodeInfo().NetAddress().String))

We should just pass the NetAddress() there, no need to call String().

But note even if we do that, we still lose the ID. That's because in

func removeProtocolIfDefined(addr string) string {
if strings.Contains(addr, "://") {
return strings.Split(addr, "://")[1]
}
return addr
we expect the protocol to be at the beginning, but it could come after the @, eg. 76e35576b8dd1cf8049fea382fda8ac621a9c6ee@tcp://0.0.0.0:26656. So we need fix this too

@ebuchman ebuchman added T:bug Type Bug (Confirmed) C:p2p Component: P2P pkg labels Nov 7, 2018
@ebuchman ebuchman added this to the v1.0 milestone Nov 7, 2018
@ebuchman ebuchman added help wanted good first issue Contributions Welcome!! labels Nov 7, 2018
u5surf added a commit to u5surf/tendermint that referenced this issue Nov 8, 2018
u5surf added a commit to u5surf/tendermint that referenced this issue Nov 8, 2018
 Committer:  u5surf <u5.horie@gmail.com>
u5surf added a commit to u5surf/tendermint that referenced this issue Nov 8, 2018
 Committer:  u5surf <u5.horie@gmail.com>
u5surf pushed a commit to u5surf/tendermint that referenced this issue Nov 8, 2018
u5surf added a commit to u5surf/tendermint that referenced this issue Nov 8, 2018
u5surf added a commit to u5surf/tendermint that referenced this issue Nov 8, 2018
ebuchman added a commit that referenced this issue Nov 11, 2018
ebuchman pushed a commit that referenced this issue Nov 11, 2018
…mediately after sending pex addrs in seed mode (#2797)

* Require addressbook to only store addresses with valid ID

* Do not shut down peer immediately after sending pex addrs in SeedMode

* p2p: fix #2773

* seed mode: use go-routine to sleep before stopping peer
@ebuchman
Copy link
Contributor Author

Fixed in #2797

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C:p2p Component: P2P pkg good first issue Contributions Welcome!! T:bug Type Bug (Confirmed)
Projects
None yet
Development

No branches or pull requests

1 participant