From 25bf71af9b3041f5f5b6b6c0637da6e7d921ef5c Mon Sep 17 00:00:00 2001 From: barrystyle Date: Sun, 11 Aug 2019 16:58:34 +0000 Subject: [PATCH] continue on "Cannot read property length of undefined" --- lib/database.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/database.js b/lib/database.js index 619f3a15e..93b04eda4 100644 --- a/lib/database.js +++ b/lib/database.js @@ -639,6 +639,7 @@ module.exports = { if (blockhash) { lib.get_block(blockhash, function(block) { if (block) { + try { lib.syncLoop(block.tx.length, function (subloop) { var i = subloop.iteration(); Tx.findOne({txid: block.tx[i]}, function(err, tx) { @@ -664,6 +665,7 @@ module.exports = { block = null; loop.next(); }); + } catch (e) {} } else { console.log('block not found: %s', blockhash); loop.next();