From 3998146046c3df3b06c35f7c2a781ecee1f82219 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Sun, 18 May 2014 09:53:15 -0500 Subject: [PATCH] block: avoid error by ensuring hashes and flags for non-merkleblocks. Signed-off-by: Fedor Indutny --- 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 d562ef34..081e934d 100644 --- a/lib/bcoin/block.js +++ b/lib/bcoin/block.js @@ -13,10 +13,10 @@ function Block(data) { this.bits = data.bits; this.nonce = data.nonce; this.totalTX = data.totalTX; - this.hashes = data.hashes.map(function(hash) { + this.hashes = (data.hashes || []).map(function(hash) { return utils.toHex(hash); }); - this.flags = data.flags; + this.flags = data.flags || []; // List of matched TXs this.tx = [];