aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2024-03-26 06:17:36 +0000
committerAdam Soltys <[email protected]>2024-03-26 06:17:36 +0000
commit0fb1c0363e3f3f87b5fc67b44027a263e269fa25 (patch)
treeb23e19a5ee303bf2fa8ed92aae9f8d41c7b149b3
parentd2fe7ed3227a2ab8a7d2c4921aeb6c6fa429a7cd (diff)
downloadcoinos-server-0fb1c0363e3f3f87b5fc67b44027a263e269fa25.tar.gz
coinos-server-0fb1c0363e3f3f87b5fc67b44027a263e269fa25.zip
validate amount
-rw-r--r--lib/payments.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/payments.js b/lib/payments.js
index 03085280..a754dc93 100644
--- a/lib/payments.js
+++ b/lib/payments.js
@@ -593,6 +593,7 @@ export let build = async ({ amount, address, feeRate, user, subtract }) => {
let node = getNode(type);
amount = parseInt(amount);
+ if (amount < 0) fail("invalid amount");
let fees = await fetch(`${api[type]}/fees/recommended`).then((r) => r.json());