mirror of
https://github.com/webtorrent/bittorrent-tracker.git
synced 2024-12-13 19:06:27 +00:00
Merge pull request #267 from jasnell/patch-1
Replace new Buffer with Buffer.from
This commit is contained in:
commit
6ce0d51c03
@ -174,7 +174,7 @@ function Server (opts) {
|
|||||||
}
|
}
|
||||||
var client = clients[peer.client.client]
|
var client = clients[peer.client.client]
|
||||||
// If the client is not known show 8 chars from peerId as version
|
// If the client is not known show 8 chars from peerId as version
|
||||||
var version = peer.client.version || new Buffer(peer.peerId, 'hex').toString().substring(0, 8)
|
var version = peer.client.version || Buffer.from(peer.peerId, 'hex').toString().substring(0, 8)
|
||||||
if (!client[version]) {
|
if (!client[version]) {
|
||||||
client[version] = 0
|
client[version] = 0
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user