diff --git a/lib/explorer.js b/lib/explorer.js index 56908e2a6..942f966f0 100644 --- a/lib/explorer.js +++ b/lib/explorer.js @@ -284,10 +284,13 @@ module.exports = { module.exports.syncLoop(vout.length, function (loop) { var i = loop.iteration(); // make sure vout has an address - if (vout[i].scriptPubKey.type != 'nonstandard' && vout[i].scriptPubKey.type != 'nulldata') { + if (vout[i].scriptPubKey.type != 'nonstandard' && vout[i].scriptPubKey.type != 'nulldata' && vout[i].scriptPubKey.hasOwnProperty("addresses")) { + //if (vout[i].scriptPubKey.type != 'nonstandard' && vout[i].scriptPubKey.type != 'nulldata' && vout[i].scriptPubKey.type != 'create' && vout[i].scriptPubKey.type != 'call') { +//mm mod from pull to fix some bad blocks on some coin. // check if vout address is unique, if so add it array, if not add its amount to existing index //console.log('vout:' + i + ':' + txid); module.exports.is_unique(arr_vout, vout[i].scriptPubKey.addresses[0], function(unique, index) { +//mm my crashing for cannot read property '0' of undefined happens on ^^^^^^ line, at that point. if (unique == true) { // unique vout module.exports.convert_to_satoshi(parseFloat(vout[i].value), function(amount_sat){ @@ -340,7 +343,7 @@ module.exports = { }); } else { module.exports.get_rawtransaction(input.txid, function(tx){ - if (tx) { + if (tx && tx.vout) { //mm mod from pull request for fixing locked file on crashes module.exports.syncLoop(tx.vout.length, function (loop) { var i = loop.iteration(); if (tx.vout[i].n == input.vout) {