From 56861c66cb1fe69085f37c4822aa321ba8e41663 Mon Sep 17 00:00:00 2001 From: coldstar Date: Tue, 25 May 2021 13:53:26 -0700 Subject: [PATCH] 05/25/2021 01:53:26 PM MST --- app/rpcApi.js | 6 +++--- package-lock.json | 1 + routes/baseActionsRouter.js | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/rpcApi.js b/app/rpcApi.js index 96e9eff..1bb3424 100755 --- a/app/rpcApi.js +++ b/app/rpcApi.js @@ -426,10 +426,10 @@ function getBlockData(rpcClient, blockHash, txLimit, txOffset) { }); } -function getBalanceFromAddress(rpcClient, address) { +function getBalance(rpcClient, address) { console.log("getBalanceFromAddress: " + address); - console.log("getaddressbalance \'{\"addresses\": [\"" + address + "\"]}\'"); + console.log("getbalance", " \'{\"addresses\": [\"" + address + "\"]}\'"); return new Promise(function(resolve, reject) { client.cmd("getaddressbalance \'{\"addresses\": [\"" + address + "\"]}\'", function(err, result, resHeaders) { @@ -463,7 +463,7 @@ module.exports = { getBlockByHeight: getBlockByHeight, getBlocksByHeight: getBlocksByHeight, getBlockByHash: getBlockByHash, - getBalanceFromAddress: getBalanceFromAddress, + getBalance: getBalance, getTransactionInputs: getTransactionInputs, getBlockData: getBlockData, getRawTransaction: getRawTransaction, diff --git a/package-lock.json b/package-lock.json index 8ade94b..98c3973 100755 --- a/package-lock.json +++ b/package-lock.json @@ -5,6 +5,7 @@ "requires": true, "packages": { "": { + "name": "rpc-explorer", "version": "1.0.0", "license": "MIT", "dependencies": { diff --git a/routes/baseActionsRouter.js b/routes/baseActionsRouter.js index 465b93e..63235b5 100755 --- a/routes/baseActionsRouter.js +++ b/routes/baseActionsRouter.js @@ -310,7 +310,7 @@ router.get("/address/:address", function(req, res) { res.locals.result = {}; // TODO handle RPC error - rpcApi.getBalanceFromAddress(client, address).then(function(result) { + rpcApi.getBalance(client, address).then(function(result) { res.locals.result.address = result.address; res.render("address");