mirror of
https://github.com/webtorrent/bittorrent-tracker.git
synced 2024-12-13 10:56:25 +00:00
perf: don't dynamically add new properties to peer objects
This commit is contained in:
parent
a65c733125
commit
6ac9ae6a6e
@ -42,7 +42,8 @@ Swarm.prototype._onAnnounce_started = function (params, peer) {
|
||||
peer = this.peers[params.addr] = {
|
||||
ip: params.ip,
|
||||
port: params.port,
|
||||
peerId: params.peer_id
|
||||
peerId: params.peer_id,
|
||||
complete: false
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -56,7 +56,8 @@ function serverTest (t, serverType, serverFamily) {
|
||||
t.deepEqual(server.getSwarm(infoHash).peers[clientAddr + ':6881'], {
|
||||
ip: clientIp,
|
||||
port: 6881,
|
||||
peerId: peerId.toString('hex')
|
||||
peerId: peerId.toString('hex'),
|
||||
complete: false
|
||||
})
|
||||
|
||||
client.complete()
|
||||
|
Loading…
Reference in New Issue
Block a user