Replace new Buffer with Buffer.from

Code is already using safe-buffer, just replace the constructor API
This commit is contained in:
James M Snell 2018-03-21 16:31:30 -07:00 committed by GitHub
parent 2cd8f3fc12
commit fcf28cbd46
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
}