Skip to content

Commit

Permalink
Display exception in tx loop (was 'Cannot read property length of und…
Browse files Browse the repository at this point in the history
…efined')
  • Loading branch information
barrystyle committed Aug 12, 2019
1 parent bf99bb5 commit fa8ec9f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/database.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -664,6 +665,9 @@ module.exports = {
block = null;
loop.next();
});
} catch (e) {
console.log('hit an exception: %s', e);
}
} else {
console.log('block not found: %s', blockhash);
loop.next();
Expand Down

0 comments on commit fa8ec9f

Please sign in to comment.