fix: simplified double ternary
fix: select XMR through the coins consts object
This commit is contained in:
parent
4314e162c6
commit
47eab0e6fc
2 changed files with 7 additions and 6 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue