Browse Source

more tweaking things related to #45

fix-133-memory-crash
Dan Janosik 7 years ago
parent
commit
ea3a40a627
  1. 4
      app/api/coreApi.js
  2. 1
      app/config.js
  3. 39
      views/includes/transaction-io-details.pug

4
app/api/coreApi.js

@ -172,7 +172,7 @@ function getMempoolDetails(start, count) {
}
getRawTransactions(txids).then(function(transactions) {
var maxInputsTracked = 10;
var maxInputsTracked = config.site.blockTxMaxInput;
var vinTxids = [];
for (var i = 0; i < transactions.length; i++) {
var transaction = transactions[i];
@ -573,7 +573,7 @@ function getBlockByHashWithTransactions(blockHash, txLimit, txOffset) {
transactions.shift();
}
var maxInputsTracked = 10;
var maxInputsTracked = config.site.blockTxMaxInput;
var vinTxids = [];
for (var i = 0; i < transactions.length; i++) {
var transaction = transactions[i];

1
app/config.js

@ -34,6 +34,7 @@ module.exports = {
site: {
blockTxPageSize:20,
blockTxMaxInput:15,
browseBlocksPageSize:20
},

39
views/includes/transaction-io-details.pug

@ -7,6 +7,7 @@ div(class="row")
div(class="col-md-6")
if (txInputs)
table(class="table monospace mb-0")
- var extraInputCount = 0;
each txVin, txVinIndex in tx.vin
if (txVin.coinbase)
tr
@ -24,18 +25,19 @@ div(class="row")
include ./value-display.pug
else
tr
th(class="pl-0 pr-1")
a(data-toggle="tooltip", title=("Input #" + (txVinIndex + 1)), style="white-space: nowrap;")
i(class=("fas fa-" + fontawesomeInputName + " mr-2"))
span #{(txVinIndex + 1)}
- var vout = null;
if (txInputs && txInputs[txVinIndex])
- var txInput = txInputs[txVinIndex];
if (txInput.vout && txInput.vout[txVin.vout])
- var vout = txInput.vout[txVin.vout];
if (vout)
tr
th(class="pl-0 pr-1")
a(data-toggle="tooltip", title=("Input #" + (txVinIndex + 1)), style="white-space: nowrap;")
i(class=("fas fa-" + fontawesomeInputName + " mr-2"))
span #{(txVinIndex + 1)}
td(class=(txVinIndex == 0 ? "border-top-0" : false), class="pl-0")
if (vout && vout.scriptPubKey && vout.scriptPubKey.addresses)
div(style="word-break: break-word;")
@ -43,15 +45,28 @@ div(class="row")
span(class="small") via
a(href=("/tx/" + txInput.txid + "#output-" + txVin.vout)) #{txInput.txid.substring(0, 20)}...[#{txVin.vout}]
else
span(class="text-danger") Unable to decode input
a(data-toggle="popover", title=JSON.stringify(txInput))
i(class="fas fa-plus-circle")
td(class=(txInputIndex == 0 ? "border-top-0" : false), class="pl-0 text-right")
td(class=(txVinIndex == 0 ? "border-top-0" : false), class="pl-0 text-right")
if (vout && vout.value)
- var currencyValue = vout.value;
include ./value-display.pug
else
- extraInputCount = extraInputCount + 1;
if (extraInputCount > 0)
tr
th(class="pl-0 pr-1")
td(class="border-top-0 pl-0")
span #{extraInputCount} Additonal
if (extraInputCount != 1)
span inputs
else
span input
a(data-toggle="tooltip", title="Additional inputs withheld for performance. See this transaction's details page for more info.")
i(class="fas fa-info-circle")
td(class="border-top-0")
tr
th

Loading…
Cancel
Save