Skip to content

Commit

Permalink
fix index errors
Browse files Browse the repository at this point in the history
iquidus/explorer#56

Resolves this ^^^^
  • Loading branch information
CryptoCoderz authored Aug 17, 2020
1 parent 6f4d9d0 commit a45e52d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/explorer.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,14 @@ 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') {
/* - PATCH FOR ERRORS IN TX INDEX -
rbtgit commented on Feb 24, 2018
I've had this issue and fixed it by changing the following line in explorer.js:
if (vout[i].scriptPubKey.type != 'nonstandard' && vout[i].scriptPubKey.type != 'nulldata') {
to
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.hasOwnProperty("addresses")) {
// 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) {
Expand Down

0 comments on commit a45e52d

Please sign in to comment.