fixed cashOut rates bug
This commit is contained in:
parent
93983c9645
commit
87fdb355b2
6 changed files with 733 additions and 5090 deletions
|
|
@ -10,7 +10,7 @@ const machineLoader = require('../machine-loader')
|
|||
const CONSIDERED_UP_SECS = 30
|
||||
|
||||
function checkWasConfigured () {
|
||||
settingsLoader.loadLatest()
|
||||
return settingsLoader.loadLatest()
|
||||
.then(() => true)
|
||||
.catch(() => false)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,6 +57,8 @@ function sendNoAlerts (plugins) {
|
|||
}
|
||||
|
||||
function checkNotification (plugins) {
|
||||
if (!plugins.notificationsEnabled()) return Promise.resolve()
|
||||
|
||||
return checkStatus(plugins)
|
||||
.then(alertRec => {
|
||||
const currentAlertFingerprint = buildAlertFingerprint(alertRec)
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ function plugins (settings, deviceId) {
|
|||
const cashInCommission = BN(1).add(BN(cryptoConfig.cashInCommission).div(100))
|
||||
|
||||
const cashOutCommission = _.isNil(cryptoConfig.cashOutCommission)
|
||||
? null
|
||||
? undefined
|
||||
: BN(1).add(BN(cryptoConfig.cashOutCommission).div(100))
|
||||
|
||||
if (Date.now() - rateRec.timestamp > STALE_TICKER) return logger.warn('Stale rate for ' + cryptoCode)
|
||||
|
|
@ -56,9 +56,16 @@ function plugins (settings, deviceId) {
|
|||
}
|
||||
})
|
||||
|
||||
console.log('DEBUG100: %j', rates)
|
||||
|
||||
return rates
|
||||
}
|
||||
|
||||
function notificationsEnabled () {
|
||||
const config = configManager.unscoped(settings.config)
|
||||
return config.notificationsEnabled
|
||||
}
|
||||
|
||||
function buildBalances (balanceRecs) {
|
||||
const config = configManager.machineScoped(deviceId, settings.config)
|
||||
const cryptoCodes = config.cryptoCurrencies
|
||||
|
|
@ -606,7 +613,8 @@ function plugins (settings, deviceId) {
|
|||
getMachineNames,
|
||||
buildAvailableCassettes,
|
||||
buy,
|
||||
sell
|
||||
sell,
|
||||
notificationsEnabled
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
4618
package-lock.json
generated
4618
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -430,6 +430,10 @@ p {
|
|||
border-color: #eb6b6e;
|
||||
}
|
||||
|
||||
.lamassuAdminConfigTable .lamassuAdminInvalidComponent > .lamassuAdminSelectizeContainer {
|
||||
border-color: #eb6b6e;
|
||||
}
|
||||
|
||||
.lamassuAdminConfigTable tbody td {
|
||||
text-align: right;
|
||||
white-space: nowrap;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue