Browse Source

fixes for displaying addresses that have no transactions

fix-133-memory-crash
Dan Janosik 6 years ago
parent
commit
6b88f9e08d
  1. 4
      app/api/coreApi.js
  2. 6
      routes/baseActionsRouter.js
  3. 3
      views/address.pug

4
app/api/coreApi.js

@ -601,9 +601,9 @@ function getRawTransactionsWithInputs(txids, maxInputs=-1) {
}
}
}
resolve({ transactions:transactions, txInputsByTransaction:txInputsByTransaction });
});
resolve({ transactions:transactions, txInputsByTransaction:txInputsByTransaction });
});
});
});

6
routes/baseActionsRouter.js

@ -604,9 +604,11 @@ router.get("/address/:address", function(req, res) {
var pagedTxids = [];
for (var i = offset; i < (offset + limit); i++) {
pagedTxids.push(txids[i]);
if (txids.length > i) {
pagedTxids.push(txids[i]);
}
}
coreApi.getRawTransactionsWithInputs(pagedTxids).then(function(rawTxResult) {
res.locals.transactions = rawTxResult.transactions;
res.locals.txInputsByTransaction = rawTxResult.txInputsByTransaction;

3
views/address.pug

@ -220,6 +220,9 @@ block content
span The transaction history for this address was requested from mulitple ElectrumX servers and the results did not match. The results below were obtained only from
span(class="font-weight-bold") #{electrumHistory.server}
if (!transactions || transactions.length == 0)
span No transactions found
if (transactions)
each tx, txIndex in transactions
//pre

Loading…
Cancel
Save