Browse Source
Switching deprecated buffer constructor to use Buffer.from
patch-2
Micah Riggan
7 years ago
No known key found for this signature in database
GPG Key ID: 1DF0722D8116EE83
2 changed files with
3 additions and
4 deletions
-
lib/address.js
-
lib/transaction/transaction.js
|
|
@ -463,9 +463,8 @@ Address.prototype.isPayToScriptHash = function() { |
|
|
|
* @returns {Buffer} Bitcoin address buffer |
|
|
|
*/ |
|
|
|
Address.prototype.toBuffer = function() { |
|
|
|
var version = new Buffer([this.network[this.type]]); |
|
|
|
var buf = Buffer.concat([version, this.hashBuffer]); |
|
|
|
return buf; |
|
|
|
var version = Buffer.from([this.network[this.type]]); |
|
|
|
return Buffer.concat([version, this.hashBuffer]); |
|
|
|
}; |
|
|
|
|
|
|
|
/** |
|
|
|
|
|
@ -474,7 +474,7 @@ Transaction.prototype.getLockTime = function() { |
|
|
|
}; |
|
|
|
|
|
|
|
Transaction.prototype.fromString = function(string) { |
|
|
|
this.fromBuffer(new buffer.Buffer(string, 'hex')); |
|
|
|
this.fromBuffer(buffer.Buffer.from(string, 'hex')); |
|
|
|
}; |
|
|
|
|
|
|
|
Transaction.prototype._newTransaction = function() { |
|
|
|