diff --git a/routes/shepherd/electrum/balance.js b/routes/shepherd/electrum/balance.js index f77bd60..2f2be33 100644 --- a/routes/shepherd/electrum/balance.js +++ b/routes/shepherd/electrum/balance.js @@ -141,5 +141,6 @@ module.exports = (shepherd) => { } }); }); + return shepherd; }; \ No newline at end of file diff --git a/routes/shepherd/electrum/keys.js b/routes/shepherd/electrum/keys.js index 6ad3eb5..6c4b3ca 100644 --- a/routes/shepherd/electrum/keys.js +++ b/routes/shepherd/electrum/keys.js @@ -69,6 +69,7 @@ module.exports = (shepherd) => { shepherd.post('/electrum/keys', (req, res, next) => { let _matchingKeyPairs = 0; + let _totalKeys = 0; let _electrumKeys = {}; for (let key in shepherd.electrumServers) { @@ -79,6 +80,7 @@ module.exports = (shepherd) => { shepherd.electrumKeys[_abbr].priv === priv) { _matchingKeyPairs++; } + _totalKeys++; } if (req.body.active) { @@ -93,11 +95,9 @@ module.exports = (shepherd) => { _electrumKeys = shepherd.electrumKeys; } - // shepherd.log(JSON.stringify(_electrumKeys, null, '\t'), true); - const successObj = { msg: 'success', - result: _matchingKeyPairs === Object.keys(shepherd.electrumKeys).length ? _electrumKeys : false, + result: _matchingKeyPairs === _totalKeys ? _electrumKeys : false, }; res.end(JSON.stringify(successObj));