diff --git a/lib/blockchain/common.js b/lib/blockchain/common.js index 1c91bf57..1f3c2d08 100644 --- a/lib/blockchain/common.js +++ b/lib/blockchain/common.js @@ -102,10 +102,11 @@ function writeSupervisorConfig (coinRec, cmd, walletCmd = '') { } function isInstalledSoftware (coinRec) { - return !_.isNil(coinRec.wallet) - ? fs.existsSync(`/etc/supervisor/conf.d/${coinRec.code}.conf`) - && fs.existsSync(`/etc/supervisor/conf.d/${coinRec.code}-wallet.conf`) - : fs.existsSync(`/etc/supervisor/conf.d/${coinRec.code}.conf`) + const nodeInstalled = fs.existsSync(`/etc/supervisor/conf.d/${coinRec.code}.conf`) + const walletInstalled = _.isNil(coinRec.wallet) + ? true + : fs.existsSync(`/etc/supervisor/conf.d/${coinRec.code}.wallet.conf`) + return nodeInstalled && walletInstalled } function fetchAndInstall (coinRec) { diff --git a/lib/plugins/wallet/monerod/monerod.js b/lib/plugins/wallet/monerod/monerod.js index 1a28e6e6..e29f90fd 100644 --- a/lib/plugins/wallet/monerod/monerod.js +++ b/lib/plugins/wallet/monerod/monerod.js @@ -3,14 +3,14 @@ const path = require('path') const _ = require('lodash/fp') const jsonRpc = require('../../common/json-rpc') -const { utils } = require('lamassu-coins') +const { COINS, utils } = require('lamassu-coins') const blockchainUtils = require('../../../coin-utils') const BN = require('../../../bn') const E = require('../../../error') const { logger } = require('../../../blockchain/common') -const cryptoRec = utils.getCryptoCurrency('XMR') +const cryptoRec = utils.getCryptoCurrency(COINS.XMR) const configPath = utils.configPath(cryptoRec, blockchainUtils.blockchainDir()) const walletDir = path.resolve(utils.cryptoDir(cryptoRec, blockchainUtils.blockchainDir()), 'wallets') const unitScale = cryptoRec.unitScale