diff --git a/lib/blockchainexplorers/insight.js b/lib/blockchainexplorers/insight.js index 9393bbd..6ed489d 100644 --- a/lib/blockchainexplorers/insight.js +++ b/lib/blockchainexplorers/insight.js @@ -63,14 +63,14 @@ Insight.prototype.translateResultAddresses = function(addresses) { Insight.prototype.translateTx = function(tx) { if (!this.shouldTranslateAddresses) return tx; - _.each(tx.input, function(x){ + _.each(tx.vin, function(x){ if (x.addr) { x.addr = AddressTranslator.translateOutput(x.addr); } }); - _.each(tx.output, function(x){ + _.each(tx.vout, function(x){ if (x.scriptPubKey && x.scriptPubKey.addresses) { x.scriptPubKey.addresses = AddressTranslator.translateOutput(x.scriptPubKey.addresses); } @@ -202,6 +202,7 @@ Insight.prototype.getTransactions = function(addresses, from, to, cb) { if (!_.isArray(txs) || (txs.length != _.compact(txs).length)) return cb(new Error('Could not retrieve transactions from blockchain. Request was:' + JSON.stringify(args))); if (self.shouldTranslateAddresses) { + _.each(txs, function(tx){ self.translateTx(tx); });