Browse Source

05/25/2021 01:53:26 PM MST

master
coldstar 2 years ago
parent
commit
56861c66cb
3 changed files with 5 additions and 4 deletions
  1. +3
    -3
      app/rpcApi.js
  2. +1
    -0
      package-lock.json
  3. +1
    -1
      routes/baseActionsRouter.js

+ 3
- 3
app/rpcApi.js View File

@@ -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,


+ 1
- 0
package-lock.json View File

@@ -5,6 +5,7 @@
"requires": true,
"packages": {
"": {
"name": "rpc-explorer",
"version": "1.0.0",
"license": "MIT",
"dependencies": {


+ 1
- 1
routes/baseActionsRouter.js View File

@@ -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");


Loading…
Cancel
Save