feat: migrate old tx addresses to blacklist table
feat: add new addresses to blacklist list
This commit is contained in:
parent
60415e23f3
commit
f682a77eb5
2 changed files with 16 additions and 5 deletions
|
|
@ -134,11 +134,8 @@ function postProcess (r, pi, isBlacklisted, addressReuse) {
|
||||||
})
|
})
|
||||||
.then(sendRec => {
|
.then(sendRec => {
|
||||||
settingsLoader.loadLatest().then(it => {
|
settingsLoader.loadLatest().then(it => {
|
||||||
const rejectAddressReuseActive = configManager.getCompliance(it.config).rejectAddressReuse
|
blacklist.addToUsedAddresses(r.tx.toAddress, r.tx.cryptoCode)
|
||||||
if (rejectAddressReuseActive) {
|
.catch(err => logger.error('Failure adding to addressReuse', err))
|
||||||
blacklist.addToUsedAddresses(r.tx.toAddress, r.tx.cryptoCode)
|
|
||||||
.catch(err => logger.error('Failure adding to addressReuse', err))
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
pi.notifyOperator(r.tx, sendRec)
|
pi.notifyOperator(r.tx, sendRec)
|
||||||
|
|
|
||||||
14
migrations/1624214428956-txs-addresses-to-blacklist.js
Normal file
14
migrations/1624214428956-txs-addresses-to-blacklist.js
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
var db = require('./db')
|
||||||
|
|
||||||
|
exports.up = function (next) {
|
||||||
|
var sql = [
|
||||||
|
`INSERT INTO blacklist SELECT DISTINCT crypto_code, to_address, false FROM cash_in_txs ON CONFLICT DO NOTHING`,
|
||||||
|
`INSERT INTO blacklist SELECT DISTINCT crypto_code, to_address, false FROM cash_out_txs ON CONFLICT DO NOTHING`
|
||||||
|
]
|
||||||
|
|
||||||
|
db.multi(sql, next)
|
||||||
|
}
|
||||||
|
|
||||||
|
exports.down = function (next) {
|
||||||
|
next()
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue