mirror of
https://github.com/sot-tech/mochi.git
synced 2026-05-11 22:51:16 -07:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user