diff --git a/p2p/net/swarm/swarm_dial.go b/p2p/net/swarm/swarm_dial.go index f7feb4d78f..f337c76f7e 100644 --- a/p2p/net/swarm/swarm_dial.go +++ b/p2p/net/swarm/swarm_dial.go @@ -7,6 +7,7 @@ import ( "sync" "time" + "github.com/libp2p/go-libp2p-core/canonicallog" "github.com/libp2p/go-libp2p-core/network" "github.com/libp2p/go-libp2p-core/peer" "github.com/libp2p/go-libp2p-core/transport" @@ -387,6 +388,7 @@ func (s *Swarm) dialAddr(ctx context.Context, p peer.ID, addr ma.Multiaddr) (tra if err != nil { return nil, err } + canonicallog.LogPeerStatus(100, connC.RemotePeer(), connC.RemoteMultiaddr(), "connection_status", "established", "dir", "inbound") // Trust the transport? Yeah... right. if connC.RemotePeer() != p { diff --git a/p2p/net/swarm/swarm_listen.go b/p2p/net/swarm/swarm_listen.go index 94fc6cce90..053e0f9a3b 100644 --- a/p2p/net/swarm/swarm_listen.go +++ b/p2p/net/swarm/swarm_listen.go @@ -4,6 +4,7 @@ import ( "fmt" "time" + "github.com/libp2p/go-libp2p-core/canonicallog" "github.com/libp2p/go-libp2p-core/network" "github.com/libp2p/go-libp2p-core/transport" @@ -124,6 +125,7 @@ func (s *Swarm) AddListenAddr(a ma.Multiaddr) error { if err != nil { return } + canonicallog.LogPeerStatus(100, c.RemotePeer(), c.RemoteMultiaddr(), "connection_status", "established", "dir", "outbound") log.Debugf("swarm listener accepted connection: %s", c) s.refs.Add(1) diff --git a/p2p/net/upgrader/upgrader.go b/p2p/net/upgrader/upgrader.go index f48b4ca10d..4f8e712254 100644 --- a/p2p/net/upgrader/upgrader.go +++ b/p2p/net/upgrader/upgrader.go @@ -9,7 +9,6 @@ import ( "github.com/libp2p/go-libp2p/p2p/net/pnet" - "github.com/libp2p/go-libp2p-core/canonicallog" "github.com/libp2p/go-libp2p-core/connmgr" "github.com/libp2p/go-libp2p-core/network" "github.com/libp2p/go-libp2p-core/peer" @@ -178,8 +177,6 @@ func (u *upgrader) upgrade(ctx context.Context, t transport.Transport, maconn ma return nil, fmt.Errorf("failed to negotiate stream multiplexer: %s", err) } - canonicallog.LogPeerStatus(100, sconn.RemotePeer(), maconn.RemoteMultiaddr(), "connection_status", "established") - tc := &transportConn{ MuxedConn: smconn, ConnMultiaddrs: maconn,