diff options
| author | Adam Soltys <[email protected]> | 2025-02-04 17:30:14 +0000 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2025-02-04 17:30:14 +0000 |
| commit | 581fb404e212b5993fbec153a87e9b7bfd68d578 (patch) | |
| tree | d4f4f7d3368abf5cdf44c144da04b1d759ed5e9e /lib/payments.ts | |
| parent | 4f2e4ffdd5de8819abf2fe505fca4af12d3d7f6f (diff) | |
| download | coinos-server-581fb404e212b5993fbec153a87e9b7bfd68d578.tar.gz coinos-server-581fb404e212b5993fbec153a87e9b7bfd68d578.zip | |
log login failures
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; |
