don't trade if no exchange

This commit is contained in:
Josh Harvey 2016-12-08 00:13:59 +02:00
parent e6a7a601c9
commit c80f92c227
3 changed files with 20 additions and 5 deletions

View file

@ -162,6 +162,8 @@ function trade (deviceId, rawTrade) {
.then(() => {
const market = [fiatCode, cryptoCode].join('')
if (!exchange.active(cryptoCode)) return
logger.debug('[%s] Pushing trade: %d', market, cryptoAtoms)
if (!tradesQueues[market]) tradesQueues[market] = []
tradesQueues[market].push({
@ -409,6 +411,8 @@ function executeTrades () {
}
function executeTradesForMarket (settings, fiatCode, cryptoCode) {
if (!exchange.active(cryptoCode)) return
const market = [fiatCode, cryptoCode].join('')
logger.debug('[%s] checking for trades', market)
@ -489,9 +493,7 @@ function checkNotification () {
.then(results => {
if (results && results.length > 0) logger.debug('Successfully sent alerts')
})
.catch(err => {
logger.error(err)
})
.catch(logger.error)
}
function checkDeviceBalances (deviceId) {