diff options
Diffstat (limited to 'lib/payments.ts')
| -rw-r--r-- | lib/payments.ts | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/payments.ts b/lib/payments.ts index 1468a198..af16e02e 100644 --- a/lib/payments.ts +++ b/lib/payments.ts @@ -54,8 +54,19 @@ export const debit = async ({ rate = undefined, }) => { amount = parseInt(amount); - if (type !== types.internal && (await g("freeze"))) + let blacklisted = await db.sIsMember("blacklist", user?.username?.toLowerCase()); + let whitelisted = await db.sIsMember("whitelist", user?.username?.toLowerCase()); + + if (type !== types.internal && blacklisted && !whitelisted && amount > 500) { + warn("Blocking payment", amount, hash, user.username, user.id); + fail("Problem sending payment"); + } + + if (type !== types.internal && (await g("freeze")) && amount > 1000000 && !whitelisted) { + warn("Blocking payment", amount, hash, user.username, user.id); fail("Problem sending payment"); + } + // if (!user.unlimited && amount > 1000000) // fail(`⚡️${amount} exceeds max withdrawal of ⚡️1,000,000`); let ref; |
