Browse Source

minor tweaks

fix-133-memory-crash
Dan Janosik 7 years ago
parent
commit
a4773badb8
  1. 26
      app/rpcApi.js
  2. 3
      app/utils.js
  3. 4
      views/node-details.pug
  4. 2
      views/transaction.pug

26
app/rpcApi.js

@ -325,21 +325,23 @@ function getRawTransactions(txids) {
return; return;
} }
if (txids.length == 1 && txids[0] == coins[env.coin].genesisCoinbaseTransactionId) { if (coins[env.coin].genesisCoinbaseTransactionId) {
// copy the "confirmations" field from genesis block to the genesis-coinbase tx if (txids.length == 1 && txids[0] == coins[env.coin].genesisCoinbaseTransactionId) {
getBlockByHeight(0).then(function(blockZeroResult) { // copy the "confirmations" field from genesis block to the genesis-coinbase tx
var result = coins[env.coin].genesisCoinbaseTransaction; getBlockByHeight(0).then(function(blockZeroResult) {
result.confirmations = blockZeroResult.getblock.confirmations; var result = coins[env.coin].genesisCoinbaseTransaction;
result.confirmations = blockZeroResult.getblock.confirmations;
resolve([result]); resolve([result]);
}).catch(function(err) { }).catch(function(err) {
reject(err); reject(err);
return; return;
}); });
return; return;
}
} }
var requests = []; var requests = [];
@ -387,7 +389,7 @@ function executeBatchesSequentiallyInternal(batchId, batches, currentIndex, accu
results.forEach((item) => { results.forEach((item) => {
accumulatedResults.push(item); accumulatedResults.push(item);
count--; count--;
}); });
if (count == 0) { if (count == 0) {

3
app/utils.js

@ -150,5 +150,6 @@ module.exports = {
getRandomString: getRandomString, getRandomString: getRandomString,
formatBytes: formatBytes, formatBytes: formatBytes,
formatCurrencyAmount: formatCurrencyAmount, formatCurrencyAmount: formatCurrencyAmount,
formatExchangedCurrency: formatExchangedCurrency formatExchangedCurrency: formatExchangedCurrency,
addThousandsSeparators: addThousandsSeparators
}; };

4
views/node-details.pug

@ -21,6 +21,10 @@ block content
if (true) if (true)
table(class="table") table(class="table")
tr
th(class="table-active properties-header") Host : Port
td(class="monospace") #{env.rpc.host + " : " + env.rpc.port}
tr tr
th(class="table-active properties-header") Chain th(class="table-active properties-header") Chain
td(class="monospace") #{getblockchaininfo.chain} td(class="monospace") #{getblockchaininfo.chain}

2
views/transaction.pug

@ -125,7 +125,7 @@ block content
span(class="text-muted") (#{utils.formatCurrencyAmount(totalInputValue, currencyFormatType)} - #{utils.formatCurrencyAmount(totalOutputValue, currencyFormatType)}) span(class="text-muted") (#{utils.formatCurrencyAmount(totalInputValue, currencyFormatType)} - #{utils.formatCurrencyAmount(totalOutputValue, currencyFormatType)})
br br
span ~#{new DecimalRounded(totalInputValue).minus(totalOutputValue).dividedBy(result.getrawtransaction.size).times(100000000)} sat/B span ~#{utils.addThousandsSeparators(new DecimalRounded(totalInputValue).minus(totalOutputValue).dividedBy(result.getrawtransaction.size).times(100000000))} sat/B
if (result.getrawtransaction.vin[0].coinbase) if (result.getrawtransaction.vin[0].coinbase)
div(class="card mb-3") div(class="card mb-3")

Loading…
Cancel
Save