aboutsummaryrefslogtreecommitdiffstats
path: root/routes/send.js
diff options
context:
space:
mode:
Diffstat (limited to 'routes/send.js')
-rw-r--r--routes/send.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/routes/send.js b/routes/send.js
index ec6f924e..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");
}
@@ -180,7 +182,7 @@ export default async (req, res, next) => {
if (invoice) {
params.invoice_id = invoice.id;
- let c = convert[invoice.text];
+ let c = store.convert[invoice.text];
if (c) {
l(
"internal payment detected for conversion",