Browse Source

more work on #45

fix-133-memory-crash
Dan Janosik 7 years ago
parent
commit
f20cb81483
  1. 12
      app/utils.js

12
app/utils.js

@ -216,11 +216,12 @@ function getMinerFromCoinbaseTx(tx) {
function getTxTotalInputOutputValues(tx, txInputs, blockHeight) {
var totalInputValue = new Decimal(0);
if (tx.vin[0].coinbase) {
totalInputValue = totalInputValue.plus(new Decimal(coinConfig.blockRewardFunction(blockHeight)));
}
for (var i = 0; i < tx.vin.length; i++) {
if (tx.vin[i].coinbase) {
totalInputValue = totalInputValue.plus(new Decimal(coinConfig.blockRewardFunction(blockHeight)));
} else {
var txInput = txInputs[i];
if (txInput) {
@ -229,8 +230,9 @@ function getTxTotalInputOutputValues(tx, txInputs, blockHeight) {
if (vout.value) {
totalInputValue = totalInputValue.plus(new Decimal(vout.value));
}
} catch {
console.log("Error getting tx.totalInputValue: txid=" + tx.txid + ", index=tx.vin[" + i + "]");
} catch (err) {
console.log("Error getting tx.totalInputValue: err=" + err + ", txid=" + tx.txid + ", index=tx.vin[" + i + "]");
}
}
}
}

Loading…
Cancel
Save