fix: get blacklist message associated with address
This commit is contained in:
parent
e1811daf24
commit
a56336282f
2 changed files with 2 additions and 3 deletions
|
|
@ -27,7 +27,6 @@ const insertIntoBlacklist = address => {
|
||||||
function blocked (address) {
|
function blocked (address) {
|
||||||
const sql = `SELECT address, content FROM blacklist b LEFT OUTER JOIN blacklist_messages bm ON bm.id = b.blacklist_message_id WHERE address = $1`
|
const sql = `SELECT address, content FROM blacklist b LEFT OUTER JOIN blacklist_messages bm ON bm.id = b.blacklist_message_id WHERE address = $1`
|
||||||
return db.oneOrNone(sql, [address])
|
return db.oneOrNone(sql, [address])
|
||||||
.then(r => !_.isNil(r))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getMessages () {
|
function getMessages () {
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,6 @@ function post (machineTx, pi) {
|
||||||
return cashInAtomic.atomic(machineTx, pi)
|
return cashInAtomic.atomic(machineTx, pi)
|
||||||
.then(r => {
|
.then(r => {
|
||||||
const updatedTx = r.tx
|
const updatedTx = r.tx
|
||||||
let blacklisted = null
|
|
||||||
let addressReuse = false
|
let addressReuse = false
|
||||||
|
|
||||||
const promises = [settingsLoader.loadLatestConfig()]
|
const promises = [settingsLoader.loadLatestConfig()]
|
||||||
|
|
@ -47,8 +46,9 @@ function post (machineTx, pi) {
|
||||||
}
|
}
|
||||||
|
|
||||||
return Promise.all(promises)
|
return Promise.all(promises)
|
||||||
.then(([config, isBlacklisted = false, isReusedAddress = false, walletScore = null]) => {
|
.then(([config, blacklisted = false, isReusedAddress = false, walletScore = null]) => {
|
||||||
const { rejectAddressReuse } = configManager.getCompliance(config)
|
const { rejectAddressReuse } = configManager.getCompliance(config)
|
||||||
|
const isBlacklisted = !!blacklisted
|
||||||
|
|
||||||
if (isBlacklisted) {
|
if (isBlacklisted) {
|
||||||
notifier.notifyIfActive('compliance', 'blacklistNotify', r.tx, false)
|
notifier.notifyIfActive('compliance', 'blacklistNotify', r.tx, false)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue