diff --git a/lib/cash-in/cash-in-tx.js b/lib/cash-in/cash-in-tx.js
index 19f9b76d..82d09bb6 100644
--- a/lib/cash-in/cash-in-tx.js
+++ b/lib/cash-in/cash-in-tx.js
@@ -7,7 +7,7 @@ const db = require('../db')
const plugins = require('../plugins')
const logger = require('../logger')
const settingsLoader = require('../new-settings-loader')
-// const configManager = require('../new-config-manager')
+const configManager = require('../new-config-manager')
const cashInAtomic = require('./cash-in-atomic')
const cashInLow = require('./cash-in-low')
@@ -26,9 +26,7 @@ function post (machineTx, pi) {
return Promise.all([settingsLoader.loadLatest(), checkForBlacklisted(updatedTx)])
.then(([{ config }, blacklistItems]) => {
- // TODO new-admin: addressReuse doesnt exist
- // const rejectAddressReuseActive = configManager.unscoped(config).rejectAddressReuseActive
- const rejectAddressReuseActive = false
+ const rejectAddressReuseActive = configManager.getCompliance(config).rejectAddressReuse
if (_.some(it => it.created_by_operator === true)(blacklistItems)) {
blacklisted = true
@@ -125,9 +123,8 @@ function postProcess (r, pi, isBlacklisted, addressReuse) {
})
.then(sendRec => {
settingsLoader.loadLatest().then(it => {
- // TODO new-admin: addressReuse doesnt exist
- // const config = configManager.unscoped(it.config)
- if (false) {
+ const rejectAddressReuseActive = configManager.getCompliance(it.config).rejectAddressReuse
+ if (rejectAddressReuseActive) {
blacklist.addToUsedAddresses(r.tx.toAddress, r.tx.cryptoCode)
.catch(err => logger.error('Failure adding to addressReuse', err))
}
diff --git a/lib/new-config-manager.js b/lib/new-config-manager.js
index caddcbb4..7da4caad 100644
--- a/lib/new-config-manager.js
+++ b/lib/new-config-manager.js
@@ -10,7 +10,8 @@ const namespaces = {
RECEIPT: 'receipt',
COIN_ATM_RADAR: 'coinAtmRadar',
TERMS_CONDITIONS: 'termsConditions',
- CASH_OUT: 'cashOut'
+ CASH_OUT: 'cashOut',
+ COMPLIANCE: 'compliance'
}
const stripl = _.curry((q, str) => _.startsWith(q, str) ? str.slice(q.length) : str)
@@ -48,6 +49,7 @@ const getOperatorInfo = fromNamespace(namespaces.OPERATOR_INFO)
const getCoinAtmRadar = fromNamespace(namespaces.COIN_ATM_RADAR)
const getTermsConditions = fromNamespace(namespaces.TERMS_CONDITIONS)
const getReceipt = fromNamespace(namespaces.RECEIPT)
+const getCompliance = fromNamespace(namespaces.COMPLIANCE)
const getAllCryptoCurrencies = (config) => {
const locale = fromNamespace(namespaces.LOCALE)(config)
@@ -85,6 +87,7 @@ module.exports = {
getGlobalLocale,
getCommissions,
getReceipt,
+ getCompliance,
getCoinAtmRadar,
getTermsConditions,
getAllCryptoCurrencies,
diff --git a/lib/plugins.js b/lib/plugins.js
index f7805af8..9953008f 100644
--- a/lib/plugins.js
+++ b/lib/plugins.js
@@ -124,6 +124,18 @@ function plugins (settings, deviceId) {
]
}
+ function getLcmOrBigx2 (n1, n2) {
+ let big = Math.max(n1, n2);
+ let small = Math.min(n1, n2);
+
+ let i = big * 2;
+ while(i % small !== 0){
+ i += lar;
+ }
+
+ return i;
+ }
+
function buildAvailableCassettes (excludeTxId) {
const cashOutConfig = configManager.getCashOut(deviceId, settings.config)
@@ -131,8 +143,7 @@ function plugins (settings, deviceId) {
const denominations = [cashOutConfig.top, cashOutConfig.bottom]
- // TODO new-admin: will this actually be calculated?
- const virtualCassettes = [cashOutConfig.top + cashOutConfig.bottom]
+ const virtualCassettes = [getLcmOrBigx2(cashOutConfig.top, cashOutConfig.bottom)]
return Promise.all([dbm.cassetteCounts(deviceId), cashOutHelper.redeemableTxs(deviceId, excludeTxId)])
.then(([rec, _redeemableTxs]) => {
diff --git a/new-lamassu-admin/src/components/Tooltip.js b/new-lamassu-admin/src/components/Tooltip.js
index c5ba9b94..92ef7e35 100644
--- a/new-lamassu-admin/src/components/Tooltip.js
+++ b/new-lamassu-admin/src/components/Tooltip.js
@@ -9,6 +9,7 @@ const useStyles = makeStyles({
border: 'none',
backgroundColor: 'transparent',
marginTop: 4,
+ outline: 'none',
cursor: 'pointer'
},
popoverContent: ({ width }) => ({
@@ -33,18 +34,19 @@ const Tooltip = memo(({ children, width, Icon = HelpIcon }) => {
return (
Reject reused addresses
++ The "Reject reused addresses" option means that all addresses + that are used once will be automatically rejected if there's an + attempt to use them again on a new transaction. +
+