Assume upstream peers are leechers

This commit is contained in:
Matt Joiner 2022-12-29 19:42:19 +11:00
parent 4f8826483e
commit f38629d354
No known key found for this signature in database
GPG Key ID: 6B990B8185E7F782
1 changed files with 3 additions and 0 deletions

View File

@ -261,8 +261,11 @@ func (me *AnnounceHandler) augmentPeersFromUpstream(infoHash [20]byte) augmentat
InfoHash: infoHash,
Event: tracker.Started,
Port: uint16(peer.Port),
// Let's assume upstream peers are leechers without knowing better.
Left: -1,
}
copy(trackReq.PeerId[:], peer.ID)
// TODO: How do we know if these peers are leechers or seeders?
err := me.AnnounceTracker.TrackAnnounce(context.TODO(), trackReq, addrPort)
if err != nil {
log.Levelf(log.Error, "error tracking upstream peer: %v", err)