fix up crypto services

This commit is contained in:
Josh Harvey 2016-12-09 00:10:18 +02:00
parent e24da06a1b
commit 1b89ed5c76
9 changed files with 82 additions and 46 deletions

View file

@ -62,7 +62,8 @@ function poll (req, res, next) {
reboot,
rates: results.rates,
balances: results.balances,
coins: config.cryptoCurrencies
coins: config.cryptoCurrencies,
configVersion: results.currentConfigVersion
}
if (response.idVerificationEnabled) {
@ -421,13 +422,14 @@ function populateDeviceId (req, res, next) {
}
function populateSettings (req, res, next) {
const versionId = req.headers['config-version-id']
const versionId = req.headers['config-version']
if (!versionId) {
logger.debug('No config-version-id header')
logger.debug('No config-version header')
return res.sendStatus(400)
}
settingsLoader.log(versionId)
.then(settings => { req.settings = settings })
.then(() => helpers.updateDeviceConfigVersion(versionId))
.catch(next)
}