diff --git a/app/rpcApi.js b/app/rpcApi.js index c15dc52..3374776 100644 --- a/app/rpcApi.js +++ b/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)); } } diff --git a/routes/baseActionsRouter.js b/routes/baseActionsRouter.js index a978ddd..520450e 100644 --- a/routes/baseActionsRouter.js +++ b/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;