add some better logging for hello handshake failures

This commit is contained in:
whyrusleeping
2020-07-23 16:58:21 -07:00
parent 474ab02d44
commit 0594177191
2 changed files with 6 additions and 3 deletions
+3 -1
View File
@@ -41,7 +41,9 @@ func RunHello(mctx helpers.MetricsCtx, lc fx.Lifecycle, h host.Host, svc *hello.
pic := evt.(event.EvtPeerIdentificationCompleted)
go func() {
if err := svc.SayHello(helpers.LifecycleCtx(mctx, lc), pic.Peer); err != nil {
log.Warnw("failed to say hello", "error", err, "peer", pic.Peer)
protos, _ := h.Peerstore().GetProtocols(pic.Peer)
agent, _ := h.Peerstore().Get(pic.Peer, "AgentVersion")
log.Warnw("failed to say hello", "error", err, "peer", pic.Peer, "supported", protos, "agent", agent)
return
}
}()