chore: integrate new admin with l-s

This commit is contained in:
Taranto 2020-05-06 22:11:55 +01:00
parent 6b3db134e7
commit bf8f1d991c
72 changed files with 1493 additions and 1611 deletions

View file

@ -6,8 +6,8 @@ const blacklist = require('../blacklist')
const db = require('../db')
const plugins = require('../plugins')
const logger = require('../logger')
const settingsLoader = require('../settings-loader')
const configManager = require('../config-manager')
const settingsLoader = require('../new-settings-loader')
// const configManager = require('../new-config-manager')
const cashInAtomic = require('./cash-in-atomic')
const cashInLow = require('./cash-in-low')
@ -26,7 +26,9 @@ function post (machineTx, pi) {
return Promise.all([settingsLoader.loadLatest(), checkForBlacklisted(updatedTx)])
.then(([{ config }, blacklistItems]) => {
const rejectAddressReuseActive = configManager.unscoped(config).rejectAddressReuseActive
// TODO new-admin: addressReuse doesnt exist
// const rejectAddressReuseActive = configManager.unscoped(config).rejectAddressReuseActive
const rejectAddressReuseActive = true
if (_.some(it => it.created_by_operator === true)(blacklistItems)) {
blacklisted = true
@ -123,8 +125,9 @@ function postProcess (r, pi, isBlacklisted, addressReuse) {
})
.then(sendRec => {
settingsLoader.loadLatest().then(it => {
const config = configManager.unscoped(it.config)
if (config.rejectAddressReuseActive) {
// TODO new-admin: addressReuse doesnt exist
// const config = configManager.unscoped(it.config)
if (true) {
blacklist.addToUsedAddresses(r.tx.toAddress, r.tx.cryptoCode)
.catch(err => logger.error('Failure adding to addressReuse', err))
}