aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2025-02-20 18:56:42 +0000
committerAdam Soltys <[email protected]>2025-02-20 18:56:42 +0000
commit8e5395b7294e126fc54ef918ee16cf0036dd0089 (patch)
treeb6d7ecb057357e6559e60369400ddd9c6f31bdfe /lib
parent963b86386def62ea5d3098b5f6299721aa127188 (diff)
downloadcoinos-server-8e5395b7294e126fc54ef918ee16cf0036dd0089.tar.gz
coinos-server-8e5395b7294e126fc54ef918ee16cf0036dd0089.zip
handle no budget
Diffstat (limited to 'lib')
-rw-r--r--lib/nwc.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/nwc.ts b/lib/nwc.ts
index 210639e0..7039dc62 100644
--- a/lib/nwc.ts
+++ b/lib/nwc.ts
@@ -132,7 +132,7 @@ const handle = (method, params, ev, app, user) =>
);
const whitelisted = await db.sIsMember("activeNwc", pubkey);
- if ((amount > 1000 && !(whitelisted || created)) || spent + amount > max_amount) {
+ if ((amount > 1000 && !(whitelisted || created)) || (max_amount > 0 && (spent + amount > max_amount))) {
warn("budget exceeded", pubkey, user?.username, spent, amount, max_amount);
return error({
code: "QUOTA_EXCEEDED",