From f283aeaa34793359b364c41cc5171e57b8f43c7e Mon Sep 17 00:00:00 2001 From: coldstar Date: Tue, 25 May 2021 20:05:08 -0700 Subject: [PATCH] 05/25/2021 08:05:08 PM MST --- routes/baseActionsRouter.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/routes/baseActionsRouter.js b/routes/baseActionsRouter.js index d5ac2c1..44a2b13 100755 --- a/routes/baseActionsRouter.js +++ b/routes/baseActionsRouter.js @@ -307,6 +307,7 @@ router.get("/address/:address", function(req, res) { var address = req.params.address; + res.locals.address = address; console.log("address is:" + address); @@ -316,6 +317,11 @@ router.get("/address/:address", function(req, res) { res.locals.result = {}; const { exec } = require('child_process'); + + var balance = "Not Found"; + var received = "Not Found"; + + var yourscript = exec('/usr/local/bin/vivo-cli -conf=/etc/masternodes/vivo_n1.conf getaddressbalance \'{\"addresses\": [\"' + address + '"]}\'', //var yourscript = exec('whoami', (error, stdout, stderr) => { @@ -327,11 +333,12 @@ router.get("/address/:address", function(req, res) { console.log(obj.balance); console.log(obj.received); - res.locals.address = obj.address; - res.locals.balance = obj.balance; - res.locals.received = obj.received; + + balance = obj.balance; + received = obj.received; console.log(stderr); + if (error !== null) { console.log(`exec error: ${error}`); }