Skip to content

Commit fa8ec9f

Browse files
author
barrystyle
committed
Display exception in tx loop (was 'Cannot read property length of undefined')
1 parent bf99bb5 commit fa8ec9f

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

lib/database.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -639,6 +639,7 @@ module.exports = {
639639
if (blockhash) {
640640
lib.get_block(blockhash, function(block) {
641641
if (block) {
642+
try {
642643
lib.syncLoop(block.tx.length, function (subloop) {
643644
var i = subloop.iteration();
644645
Tx.findOne({txid: block.tx[i]}, function(err, tx) {
@@ -664,6 +665,9 @@ module.exports = {
664665
block = null;
665666
loop.next();
666667
});
668+
} catch (e) {
669+
console.log('hit an exception: %s', e);
670+
}
667671
} else {
668672
console.log('block not found: %s', blockhash);
669673
loop.next();

0 commit comments

Comments
 (0)