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

3
app/utils.js

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

4
views/node-details.pug

@ -21,6 +21,10 @@ block content
if (true)
table(class="table")
tr
th(class="table-active properties-header") Host : Port
td(class="monospace") #{env.rpc.host + " : " + env.rpc.port}
tr
th(class="table-active properties-header") 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)})
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)
div(class="card mb-3")

Loading…
Cancel
Save