fix blockchain configDir

This commit is contained in:
Josh Harvey 2017-07-18 21:31:51 +02:00
parent ad66fe1b43
commit d0fc03c385
5 changed files with 8 additions and 5 deletions

View file

@ -52,7 +52,7 @@ const CRYPTO_CURRENCIES = [
}
]
module.exports = {buildUrl, cryptoDir, cryptoCurrencies, getCryptoCurrency}
module.exports = {buildUrl, cryptoDir, configPath, cryptoCurrencies, getCryptoCurrency}
function getCryptoCurrency (cryptoCode) {
const cryptoCurrency = _.find(['cryptoCode', cryptoCode], CRYPTO_CURRENCIES)
@ -81,3 +81,6 @@ function cryptoDir (cryptoRec) {
return path.resolve(blockchainDir, code)
}
function configPath (cryptoRec) {
return path.resolve(cryptoDir(cryptoRec), cryptoRec.configFile)
}

View file

@ -5,7 +5,7 @@ const E = require('../../../error')
const coinUtils = require('../../../coin-utils')
const cryptoRec = coinUtils.getCryptoCurrency('BTC')
const configPath = coinUtils.cryptoDir(cryptoRec)
const configPath = coinUtils.configPath(cryptoRec)
const unitScale = cryptoRec.unitScale
const config = jsonRpc.parseConf(configPath)

View file

@ -6,7 +6,7 @@ const BN = require('../../../bn')
const E = require('../../../error')
const cryptoRec = coinUtils.getCryptoCurrency('DASH')
const configPath = coinUtils.cryptoDir(cryptoRec)
const configPath = coinUtils.configPath(cryptoRec)
const unitScale = cryptoRec.unitScale
const config = jsonRpc.parseConf(configPath)

View file

@ -6,7 +6,7 @@ const BN = require('../../../bn')
const E = require('../../../error')
const cryptoRec = coinUtils.getCryptoCurrency('LTC')
const configPath = coinUtils.cryptoDir(cryptoRec)
const configPath = coinUtils.configPath(cryptoRec)
const unitScale = cryptoRec.unitScale
const config = jsonRpc.parseConf(configPath)

View file

@ -6,7 +6,7 @@ const BN = require('../../../bn')
const E = require('../../../error')
const cryptoRec = coinUtils.getCryptoCurrency('ZEC')
const configPath = coinUtils.cryptoDir(cryptoRec)
const configPath = coinUtils.configPath(cryptoRec)
const unitScale = cryptoRec.unitScale
const config = jsonRpc.parseConf(configPath)