diff --git a/lib/wallet.js b/lib/wallet.js index 0f1ce2f2..ecdf66fc 100644 --- a/lib/wallet.js +++ b/lib/wallet.js @@ -170,6 +170,11 @@ function authorizeZeroConf (settings, tx, machineId) { return Promise.reject(new Error('tx.fiat is undefined!')) } + // TODO: confirm if this treatment is needed for ERC-20 tokens, once their cash-out transactions are enabled + if (tx.cryptoCode === 'ETH') { + return Promise.resolve(false) + } + if (tx.fiat.gt(zeroConfLimit)) { return Promise.resolve(false) } diff --git a/migrations/1661125970289-eth-zero-conf-value.js b/migrations/1661125970289-eth-zero-conf-value.js new file mode 100644 index 00000000..4376d67e --- /dev/null +++ b/migrations/1661125970289-eth-zero-conf-value.js @@ -0,0 +1,22 @@ +const _ = require('lodash/fp') + +const { saveConfig, loadLatest } = require('../lib/new-settings-loader') + +exports.up = function (next) { + const newConfig = {} + return loadLatest() + .then(config => { + if (!_.isNil(config.config.wallets_ETH_zeroConfLimit) && config.config.wallets_ETH_zeroConfLimit !== 0) { + newConfig[`wallets_ETH_zeroConfLimit`] = 0 + return saveConfig(newConfig) + } + }) + .then(next) + .catch(err => { + return next(err) + }) +} + +module.exports.down = function (next) { + next() +}