Browse Source

cleanup some old client-object passing

fix-133-memory-crash
Dan Janosik 7 years ago
parent
commit
fb0c8f2445
  1. 6
      app/rpcApi.js
  2. 4
      routes/baseActionsRouter.js

6
app/rpcApi.js

@ -288,7 +288,7 @@ function getBlockByHash(blockHash) {
});
}
function getTransactionInputs(rpcClient, transaction, inputLimit=0) {
function getTransactionInputs(transaction, inputLimit=0) {
console.log("getTransactionInputs: " + transaction.txid);
return new Promise(function(resolve, reject) {
@ -431,7 +431,7 @@ function executeBatchesSequentiallyInternal(batchId, batches, currentIndex, accu
});
}
function getBlockData(rpcClient, blockHash, txLimit, txOffset) {
function getBlockData(blockHash, txLimit, txOffset) {
console.log("getBlockData: " + blockHash);
return new Promise(function(resolve, reject) {
@ -457,7 +457,7 @@ function getBlockData(rpcClient, blockHash, txLimit, txOffset) {
var transaction = transactions[i];
if (transaction) {
promises.push(getTransactionInputs(client, transaction, 10));
promises.push(getTransactionInputs(transaction, 10));
}
}

4
routes/baseActionsRouter.js

@ -345,7 +345,7 @@ router.get("/block-height/:blockHeight", function(req, res) {
res.locals.result.getblockhash = result;
rpcApi.getBlockData(client, result, limit, offset).then(function(result) {
rpcApi.getBlockData(result, limit, offset).then(function(result) {
res.locals.result.getblock = result.getblock;
res.locals.result.transactions = result.transactions;
res.locals.result.txInputsByTransaction = result.txInputsByTransaction;
@ -378,7 +378,7 @@ router.get("/block/:blockHash", function(req, res) {
res.locals.paginationBaseUrl = "/block/" + blockHash;
// TODO handle RPC error
rpcApi.getBlockData(client, blockHash, limit, offset).then(function(result) {
rpcApi.getBlockData(blockHash, limit, offset).then(function(result) {
res.locals.result.getblock = result.getblock;
res.locals.result.transactions = result.transactions;
res.locals.result.txInputsByTransaction = result.txInputsByTransaction;

Loading…
Cancel
Save