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

@ -9,3 +9,4 @@ process.on('unhandledRejection', err => {
})
app.run()
.catch(console.log)

View file

@ -83,7 +83,7 @@ function getStatus (account, toAddress, cryptoAtoms, cryptoCode) {
if (elapsed < AUTHORIZE_TIME) return Promise.resolve({status: 'published'})
if (elapsed < CONFIRM_TIME) return Promise.resolve({status: 'authorized'})
console.log('[%s] DEBUG: Mock wallet has confirmed transaction', cryptoCode)
console.log('[%s] DEBUG: Mock wallet has confirmed transaction: %s', cryptoCode, toAddress)
return Promise.resolve({status: 'confirmed'})
}

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)