aboutsummaryrefslogtreecommitdiffstats
path: root/routes
diff options
context:
space:
mode:
Diffstat (limited to 'routes')
-rw-r--r--routes/invoices.js5
-rw-r--r--routes/payments.js1
2 files changed, 6 insertions, 0 deletions
diff --git a/routes/invoices.js b/routes/invoices.js
index c6bf4b6e..bb2673cc 100644
--- a/routes/invoices.js
+++ b/routes/invoices.js
@@ -6,6 +6,10 @@ app.post("/invoice", auth, async (req, res) => {
l.info("creating invoice", invoice.text, req.user.username, invoice.network, invoice.amount, invoice.tip, invoice.currency, invoice.rate.toFixed(2));
+ if (invoice.network === 'LBTC') {
+ invoice.unconfidential = (await lq.getAddressInfo(invoice.address)).unconfidential;
+ }
+
const exists = await db.Invoice.findOne({
where: {
[Op.or]: {
@@ -15,6 +19,7 @@ app.post("/invoice", auth, async (req, res) => {
}
});
+
res.send(
exists ? await exists.update(invoice) : await db.Invoice.create(invoice)
);
diff --git a/routes/payments.js b/routes/payments.js
index f82262df..63ecb70b 100644
--- a/routes/payments.js
+++ b/routes/payments.js
@@ -21,6 +21,7 @@ const { join } = require("path");
as: 'user'}]
}).map(i => {
if (i.address && i.user) addresses[i.address] = i.user.username;
+ if (i.unconfidential && i.user) addresses[i.unconfidential] = i.user.username;
});
payments = (