enforce byte arrays in block.render().

This commit is contained in:
Christopher Jeffrey 2016-01-28 15:09:59 -08:00
parent 919c41aebe
commit a6c2270775

View File

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