aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--routes/payments.ts11
1 files changed, 7 insertions, 4 deletions
diff --git a/routes/payments.ts b/routes/payments.ts
index 5e31d8b8..e3cd8e5e 100644
--- a/routes/payments.ts
+++ b/routes/payments.ts
@@ -839,12 +839,15 @@ export default {
created: Date.now(),
};
- const m = await db.multi();
+ const m = db.multi();
m.set(`invoice:${invoice.id}`, JSON.stringify(invoice))
.set(`payment:${p.id}`, JSON.stringify(p))
.lPush(`${aid || uid}:payments`, p.id)
- .set(`${aid || uid}:payments:last`, p.created)
- .exec();
+ .set(`${aid || uid}:payments:last`, p.created);
+
+ if (hash) m.set(`payment:${aid || uid}:${hash}`, p.id);
+
+ await m.exec();
await completePayment(invoice, p, user);
@@ -880,7 +883,7 @@ export default {
aid,
amount: tx.amount,
hash: tx.hash,
- confirmed: tx.settled,
+ confirmed: true,
rate,
currency,
type: PaymentType.ark,