Skip to content

Commit

Permalink
Don't error when we can't figure out an inputs address.
Browse files Browse the repository at this point in the history
  • Loading branch information
caedesvvv committed Oct 22, 2014
1 parent 8a04d60 commit 5e51ad6
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions js/model/history.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,12 @@ History.prototype.buildHistoryRow = function(transaction, height) {
myInValue += output.value;
addPocketImpact(inPocket, inPocketType, -output.value);
} else {
var address = BtcUtils.getInputAddress(anIn, this.identity.wallet.versions);
inAddress = address || inAddress;
try {
var address = BtcUtils.getInputAddress(anIn, this.identity.wallet.versions);
inAddress = address || inAddress;
} catch (e) {
console.log("error decoding input", anIn);
}
}
}
if (!inMine) {
Expand Down Expand Up @@ -204,7 +208,7 @@ History.prototype.txFetched = function(transaction, height) {
// unknown for now means we need to fill in some extra inputs for now get 1st one
if (newRow.address == 'unknown') {
if (newRow.tx.ins[0])
this.identity.txdb.fetchTransaction(Bitcoin.bufferutils.reverse(newRow.tx.ins[0]).hash.toString('hex'),
this.identity.txdb.fetchTransaction(Bitcoin.bufferutils.reverse(newRow.tx.ins[0].hash).toString('hex'),
function(_a, _b) {self.fillInput(_a, _b);},
[newRow.tx.ins[0].index, newRow]);
else {
Expand Down

0 comments on commit 5e51ad6

Please sign in to comment.