From 5f47e808fbcf419ed57ee6874068160c17213596 Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Thu, 16 Apr 2020 11:56:58 +1000 Subject: [PATCH] Update the peersAddedBySource expvar --- global.go | 2 -- torrent.go | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/global.go b/global.go index b9950cb2..63ac303f 100644 --- a/global.go +++ b/global.go @@ -29,8 +29,6 @@ func defaultPeerExtensionBytes() PeerExtensionBits { var ( torrent = expvar.NewMap("torrent") - peersAddedBySource = expvar.NewMap("peersAddedBySource") - pieceHashedCorrect = expvar.NewInt("pieceHashedCorrect") pieceHashedNotCorrect = expvar.NewInt("pieceHashedNotCorrect") diff --git a/torrent.go b/torrent.go index 69a0c667..33ade6db 100644 --- a/torrent.go +++ b/torrent.go @@ -255,7 +255,7 @@ func (t *Torrent) unclosedConnsAsSlice() (ret []*PeerConn) { func (t *Torrent) addPeer(p Peer) { cl := t.cl - peersAddedBySource.Add(string(p.Source), 1) + torrent.Add(fmt.Sprintf("peers added by source %q", p.Source), 1) if t.closed.IsSet() { return }