Organize peers by subnet.

This commit restructures PeerMaps to be a map from Subnet to
PeerID to Peer. This reduces the complexity require to gather peers from
the same subnet.
This commit is contained in:
Jimmy Zelinskie
2014-09-23 23:00:50 -04:00
parent 6a96245d90
commit b910fdabf5
7 changed files with 131 additions and 118 deletions

View File

@@ -359,8 +359,8 @@ func loadPrivateTestData(tkr *tracker.Tracker) {
torrent := &models.Torrent{
ID: 1,
Infohash: infoHash,
Seeders: models.NewPeerMap(true),
Leechers: models.NewPeerMap(false),
Seeders: models.NewPeerMap(true, tkr.Config),
Leechers: models.NewPeerMap(false, tkr.Config),
}
tkr.PutTorrent(torrent)