From 2af05db385b8bd0097f5c1e5659969ad5c7df87e Mon Sep 17 00:00:00 2001 From: Dan Janosik Date: Sun, 23 Sep 2018 13:36:13 -0400 Subject: [PATCH] better error handling when searching before this change, searching for a 64-char string that didn't correspond to a block hash would fail due to lack of proper error handling on the RpcError response when running the interpret-string-as-blockhash step --- app/api/rpcApi.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/api/rpcApi.js b/app/api/rpcApi.js index a93effc..68baed6 100644 --- a/app/api/rpcApi.js +++ b/app/api/rpcApi.js @@ -111,7 +111,9 @@ function getBlocksByHash(blockHashes) { var blocks = []; client.command(batch).then((responses) => { responses.forEach((item) => { - blocks.push(item); + if (item.tx) { + blocks.push(item); + } }); var coinbaseTxids = [];