diff --git a/routes/shepherd/dashboardUpdate.js b/routes/shepherd/dashboardUpdate.js index 8223bee..90accb0 100644 --- a/routes/shepherd/dashboardUpdate.js +++ b/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; + } } } } diff --git a/routes/shepherd/init.js b/routes/shepherd/init.js index f919090..fb441e5 100644 --- a/routes/shepherd/init.js +++ b/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]); } } diff --git a/routes/shepherd/rpc.js b/routes/shepherd/rpc.js index d43f5c8..08bd625 100644 --- a/routes/shepherd/rpc.js +++ b/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}`);