mirror of
https://github.com/webtorrent/bittorrent-tracker.git
synced 2025-01-31 02:21:36 +00:00
Replace new Buffer with Buffer.from
Code is already using safe-buffer, just replace the constructor API
This commit is contained in:
parent
2cd8f3fc12
commit
fcf28cbd46
@ -174,7 +174,7 @@ function Server (opts) {
|
||||
}
|
||||
var client = clients[peer.client.client]
|
||||
// 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]) {
|
||||
client[version] = 0
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user