Skip to content

Commit

Permalink
prevent index script from erroring on non-standard transactions
Browse files Browse the repository at this point in the history
  • Loading branch information
lyoshenka committed May 4, 2016
1 parent b9645a8 commit 2c0cf36
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/explorer.js
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,9 @@ module.exports = {
var i = loop.iteration();
if (tx.vout[i].n == input.vout) {
//module.exports.convert_to_satoshi(parseFloat(tx.vout[i].value), function(amount_sat){
if (tx.vout[i].scriptPubKey.addresses) {
addresses.push({hash: tx.vout[i].scriptPubKey.addresses[0], amount:tx.vout[i].value});
}
loop.break(true);
loop.next();
//});
Expand All @@ -361,7 +363,7 @@ module.exports = {
module.exports.syncLoop(tx.vin.length, function (loop) {
var i = loop.iteration();
module.exports.get_input_addresses(tx.vin[i], tx.vout, function(addresses){
if (addresses) {
if (addresses && addresses.length) {
//console.log('vin');
module.exports.is_unique(arr_vin, addresses[0].hash, function(unique, index) {
if (unique == true) {
Expand Down

0 comments on commit 2c0cf36

Please sign in to comment.