This commit is contained in:
Josh Harvey 2018-01-31 14:40:57 +02:00
parent 4625ffef0f
commit 8b267210c9
3 changed files with 13 additions and 2 deletions

View file

@ -29,7 +29,12 @@ const reboots = {}
const devMode = argv.dev || options.http
function checkHasLightning (settings) {
return configManager.cryptoScoped('BTC', settings.config).wallet === 'lnd'
}
function poll (req, res, next) {
console.log('DEBUG102')
const deviceId = req.deviceId
const deviceTime = req.deviceTime
const serialNumber = req.query.sn
@ -37,7 +42,10 @@ function poll (req, res, next) {
const settings = req.settings
const config = configManager.machineScoped(deviceId, settings.config)
const pi = plugins(settings, deviceId)
console.log('DEBUG101')
const hasLightning = checkHasLightning(settings)
console.log('DEBUG100')
pids[deviceId] = {pid, ts: Date.now()}
return pi.pollQueries(serialNumber, deviceTime, req.query)
@ -78,13 +86,15 @@ function poll (req, res, next) {
cassettes,
twoWayMode: config.cashOutEnabled,
zeroConfLimit: config.zeroConfLimit,
reboot
reboot,
hasLightning
}
if (response.idVerificationEnabled) {
response.idVerificationLimit = config.idVerificationLimit
}
console.log(response)
return res.json(_.assign(response, results))
})
.catch(next)