Update the peersAddedBySource expvar

This commit is contained in:
Matt Joiner 2020-04-16 11:56:58 +10:00
parent d4430e89b6
commit 5f47e808fb
2 changed files with 1 additions and 3 deletions

View File

@ -29,8 +29,6 @@ func defaultPeerExtensionBytes() PeerExtensionBits {
var ( var (
torrent = expvar.NewMap("torrent") torrent = expvar.NewMap("torrent")
peersAddedBySource = expvar.NewMap("peersAddedBySource")
pieceHashedCorrect = expvar.NewInt("pieceHashedCorrect") pieceHashedCorrect = expvar.NewInt("pieceHashedCorrect")
pieceHashedNotCorrect = expvar.NewInt("pieceHashedNotCorrect") pieceHashedNotCorrect = expvar.NewInt("pieceHashedNotCorrect")

View File

@ -255,7 +255,7 @@ func (t *Torrent) unclosedConnsAsSlice() (ret []*PeerConn) {
func (t *Torrent) addPeer(p Peer) { func (t *Torrent) addPeer(p Peer) {
cl := t.cl 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() { if t.closed.IsSet() {
return return
} }