Correcting addresses for multibyte versions
Fixes https://github.com/str4d/insight-ui-zcash/issues/1
This commit is contained in:
parent
b84f7ac683
commit
aeaa33f237
|
@ -460,7 +460,8 @@ Address.prototype.isPayToScriptHash = function() {
|
|||
* @returns {Buffer} Bitcoin address buffer
|
||||
*/
|
||||
Address.prototype.toBuffer = function() {
|
||||
var version = new Buffer([this.network[this.type]]);
|
||||
var version = new Buffer(2);
|
||||
version.writeUInt16BE(this.network[this.type], 0);
|
||||
var buf = Buffer.concat([version, this.hashBuffer]);
|
||||
return buf;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue