Skip to content

Commit

Permalink
Merge pull request #92 from libp2p/conn-stats
Browse files Browse the repository at this point in the history
use the new network.ConnStats
  • Loading branch information
marten-seemann authored Dec 12, 2021
2 parents e53323d + 85de7f0 commit aa4826e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions p2p/net/upgrader/conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type transportConn struct {
network.ConnMultiaddrs
network.ConnSecurity
transport transport.Transport
stat network.Stat
stat network.ConnStats
}

func (t *transportConn) Transport() transport.Transport {
Expand All @@ -35,6 +35,6 @@ func (t *transportConn) String() string {
)
}

func (t *transportConn) Stat() network.Stat {
func (t *transportConn) Stat() network.ConnStats {
return t.stat
}
2 changes: 1 addition & 1 deletion p2p/net/upgrader/upgrader.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func (u *Upgrader) Upgrade(ctx context.Context, t transport.Transport, maconn ma
if dir == network.DirOutbound && p == "" {
return nil, ErrNilPeer
}
var stat network.Stat
var stat network.ConnStats
if cs, ok := maconn.(network.ConnStat); ok {
stat = cs.Stat()
}
Expand Down

0 comments on commit aa4826e

Please sign in to comment.