diff --git a/bin/lamassu-server b/bin/lamassu-server index 33712533..420f8283 100755 --- a/bin/lamassu-server +++ b/bin/lamassu-server @@ -9,3 +9,4 @@ process.on('unhandledRejection', err => { }) app.run() +.catch(console.log) diff --git a/lib/plugins/wallet/mock-wallet/mock-wallet.js b/lib/plugins/wallet/mock-wallet/mock-wallet.js index aed5f8a9..a74b28f9 100644 --- a/lib/plugins/wallet/mock-wallet/mock-wallet.js +++ b/lib/plugins/wallet/mock-wallet/mock-wallet.js @@ -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'}) } diff --git a/lib/routes.js b/lib/routes.js index 86882de9..1c776cab 100644 --- a/lib/routes.js +++ b/lib/routes.js @@ -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)