aboutsummaryrefslogtreecommitdiffstats
path: root/routes
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2022-02-12 08:18:07 -0500
committerAdam Soltys <[email protected]>2022-02-12 08:18:17 -0500
commit98eceb8d3ad40a9952d143c89fa3cbc5a40db668 (patch)
treea63534adb1ce2489d8509739e854838876c59d5d /routes
parent9d40e5686c12141b743e5e7acaab5117a6ce746d (diff)
downloadcoinos-server-98eceb8d3ad40a9952d143c89fa3cbc5a40db668.tar.gz
coinos-server-98eceb8d3ad40a9952d143c89fa3cbc5a40db668.zip
log payreq
Diffstat (limited to 'routes')
-rw-r--r--routes/lightning/send.js2
-rw-r--r--routes/lnurl.js8
-rw-r--r--routes/send.js6
3 files changed, 8 insertions, 8 deletions
diff --git a/routes/lightning/send.js b/routes/lightning/send.js
index f6bd1b36..c0a472d8 100644
--- a/routes/lightning/send.js
+++ b/routes/lightning/send.js
@@ -5,7 +5,7 @@ module.exports = ah(async (req, res) => {
try {
res.send(await send(amount, memo, payreq, user));
} catch (e) {
- l.error("problem sending lightning payment", user.username, e.message);
+ l.error("problem sending lightning payment", user.username, payreq, e.message);
res.status(500).send(e.message);
}
});
diff --git a/routes/lnurl.js b/routes/lnurl.js
index 8987dab0..0466e143 100644
--- a/routes/lnurl.js
+++ b/routes/lnurl.js
@@ -201,7 +201,7 @@ app.post(
try {
const parts = callback.split("/");
const secret = parts[parts.length - 1];
- lnurlPayments[secret] = user;
+ lnurlPayments[secret] = user.id;
if (recipients[secret]) {
url = `${req.protocol}://${req.get("host")}/api/send`;
@@ -324,12 +324,12 @@ lnurlServer.bindToHook(
amount = Math.round(msats / 1000);
const parts = req.originalUrl.split("/");
const secret = parts[parts.length - 1].split("?")[0];
- user = lnurlPayments[secret];
+ let user_id = lnurlPayments[secret];
- if (user) {
+ if (user_id) {
let account = await db.Account.findOne({
where: {
- user_id: user.id,
+ user_id,
asset: config.liquid.btcasset,
pubkey: null
}
diff --git a/routes/send.js b/routes/send.js
index f5087f37..e44d3224 100644
--- a/routes/send.js
+++ b/routes/send.js
@@ -66,7 +66,7 @@ module.exports = ah(async (req, res, next) => {
};
if (!username) {
- // throw new Error("Vouchers temporarily disabled");
+ throw new Error("Vouchers temporarily disabled");
l.info("creating redeemable payment");
params.redeemcode = uuidv4();
params.hash = `${req.get("origin")}/redeem/${params.redeemcode}`;
@@ -94,12 +94,12 @@ module.exports = ah(async (req, res, next) => {
{ transaction }
);
- let text = address || payreq;
params = {
where: { user_id: recipient.id },
order: [["id", "DESC"]]
};
- if (text) params.where.text = text;
+ if (address) params.where.address = address;
+ else if (payreq) params.where.text = payreq;
let invoice = await db.Invoice.findOne(params);
let a2;