Only block reused address if option is on
This commit is contained in:
parent
fb42fc54a0
commit
5125601e56
2 changed files with 7 additions and 7 deletions
|
|
@ -2,7 +2,7 @@ const db = require('./db')
|
|||
|
||||
function blocked (address, cryptoCode) {
|
||||
const sql = `select * from blacklist where address = $1 and crypto_code = $2`
|
||||
return db.oneOrNone(sql, [
|
||||
return db.any(sql, [
|
||||
address,
|
||||
cryptoCode
|
||||
])
|
||||
|
|
|
|||
|
|
@ -24,13 +24,13 @@ function post (machineTx, pi) {
|
|||
let blacklisted = false
|
||||
let addressReuse = false
|
||||
|
||||
return checkForBlacklisted(updatedTx)
|
||||
.then(blacklistItem => {
|
||||
if (blacklistItem && blacklistItem.created_by_operator) {
|
||||
blacklisted = true
|
||||
}
|
||||
return Promise.all([settingsLoader.loadLatest(), checkForBlacklisted(updatedTx)])
|
||||
.then(([{ config }, blacklistItems]) => {
|
||||
const rejectAddressReuseActive = configManager.unscoped(config).rejectAddressReuseActive
|
||||
|
||||
if (blacklistItem && !blacklistItem.created_by_operator) {
|
||||
if (_.some(it => it.created_by_operator === true)(blacklistItems)) {
|
||||
blacklisted = true
|
||||
} else if (_.some(it => it.created_by_operator === false)(blacklistItems) && rejectAddressReuseActive) {
|
||||
addressReuse = true
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue