From a6c2270775b0393b0baedd430c983851f342ec3c Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Thu, 28 Jan 2016 15:09:59 -0800 Subject: [PATCH] enforce byte arrays in block.render(). --- lib/bcoin/block.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/bcoin/block.js b/lib/bcoin/block.js index 3427b503..df9a629c 100644 --- a/lib/bcoin/block.js +++ b/lib/bcoin/block.js @@ -98,7 +98,7 @@ Block.prototype.hash = function hash(enc) { Block.prototype.abbr = function abbr() { if (this.network && this._raw) - return this._raw.slice(0, 80); + return utils.toArray(this._raw.slice(0, 80)); var res = new Array(80); utils.write32(res, this.version, 0); @@ -124,7 +124,7 @@ Block.verify = function verify(data, subtype) { Block.prototype.render = function render() { if (this.network && this._raw && this._raw.length > 80) - return this._raw; + return utils.toArray(this._raw); return bcoin.protocol.framer.block(this, this.subtype); };