aboutsummaryrefslogtreecommitdiffstats
path: root/routes/send.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2022-09-13 18:12:44 -0400
committerAdam Soltys <[email protected]>2022-09-13 18:12:44 -0400
commit9f6595065f3c2433b2f542fd12ff976ff02d17e3 (patch)
tree9b9275bea0441998efb574e3debf9b2af4c33b40 /routes/send.js
parentbacae729031d54b96b0420ea05800e5dc6afd960 (diff)
downloadcoinos-server-9f6595065f3c2433b2f542fd12ff976ff02d17e3.tar.gz
coinos-server-9f6595065f3c2433b2f542fd12ff976ff02d17e3.zip
lnurl fixes
Diffstat (limited to 'routes/send.js')
-rw-r--r--routes/send.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/routes/send.js b/routes/send.js
index 002ce8d8..5d46f4de 100644
--- a/routes/send.js
+++ b/routes/send.js
@@ -30,7 +30,7 @@ export default async (req, res, next) => {
try {
await db.transaction(async transaction => {
let account;
- if (user.account.asset === asset) {
+ if (user.account.asset === asset && !user.account.pubkey) {
account = await db.Account.findOne({
where: {
id: user.account.id,
@@ -51,6 +51,8 @@ export default async (req, res, next) => {
});
}
+ if (!account) throw new Error("Account not found");
+
if (account.balance < amount) {
throw new Error("Insufficient funds");
}