Browse Source

dashboard update fix

custom-ac-example
pbca26 7 years ago
parent
commit
c24776de75
  1. 11
      routes/shepherd/dashboardUpdate.js
  2. 2
      routes/shepherd/init.js
  3. 4
      routes/shepherd/rpc.js

11
routes/shepherd/dashboardUpdate.js

@ -59,7 +59,7 @@ module.exports = (shepherd) => {
_bitcoinRPC(
coin,
_type === 'public' ? 'getaddressesbyaccount' : 'z_listaddresses',
['']
_type === 'public' ? [''] : null
)
.then((_json) => {
if (_json === 'Work queue depth exceeded' ||
@ -87,10 +87,13 @@ module.exports = (shepherd) => {
const filteredArray = json.filter(res => res.address === allAddrArray[a]).map(res => res.amount);
let isNewAddr = true;
for (let x = 0; x < result.length && isNewAddr; x++) {
for (let y = 0; y < result[x].length && isNewAddr; y++) {
if (allAddrArray[a] === result[x][y]) {
isNewAddr = false;
if (result[x]) {
for (let y = 0; y < result[x].length && isNewAddr; y++) {
if (allAddrArray[a] === result[x][y]) {
isNewAddr = false;
}
}
}
}

2
routes/shepherd/init.js

@ -18,7 +18,7 @@ module.exports = (shepherd) => {
fs.readdir(rootLocation, (err, items) => {
for (let i = 0; i < items.length; i++) {
if (items[i].substr(0, 3) === 'gen') {
shepherd.log(`remove items[i]`);
shepherd.log(`remove ${items[i]}`);
fs.unlinkSync(rootLocation + items[i]);
}
}

4
routes/shepherd/rpc.js

@ -115,8 +115,8 @@ module.exports = (shepherd) => {
}
exec(`"${_coindCliBin}" ${_arg}`, (error, stdout, stderr) => {
//shepherd.log(`stdout: ${stdout}`);
//shepherd.log(`stderr: ${stderr}`);
// shepherd.log(`stdout: ${stdout}`);
// shepherd.log(`stderr: ${stderr}`);
if (error !== null) {
shepherd.log(`exec error: ${error}`);

Loading…
Cancel
Save