From e894563fbf75706649db1b67ecdc4661bb31f9c2 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sun, 11 Oct 2020 01:12:37 -0700 Subject: get maker to check the ask price --- routes/invoices.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'routes/invoices.js') diff --git a/routes/invoices.js b/routes/invoices.js index 11d62eb6..59adb862 100644 --- a/routes/invoices.js +++ b/routes/invoices.js @@ -17,6 +17,8 @@ app.get("/invoice", auth, ah(async (req, res, next) => { app.post("/invoice", ah(async (req, res, next) => { try { let { invoice, user } = req.body; + let { blindkey } = invoice; + if (!user) ({ user } = req); else { user = await db.User.findOne({ @@ -38,7 +40,7 @@ app.post("/invoice", ah(async (req, res, next) => { invoice.currency, ); - if (invoice.network === "liquid") { + if (invoice.network === "liquid" && !invoice.unconfidential) { invoice.unconfidential = ( await lq.getAddressInfo(invoice.address) ).unconfidential; @@ -58,7 +60,10 @@ app.post("/invoice", ah(async (req, res, next) => { invoice = exists ? await exists.update(invoice) : await db.Invoice.create(invoice); addresses[invoice.address] = user.username; - if (invoice.unconfidential) addresses[invoice.unconfidential] = user.username; + if (invoice.unconfidential) { + addresses[invoice.unconfidential] = user.username; + // await lq.importBlindingKey(invoice.address, blindkey); + } res.send(invoice); } catch(e) { l.error(e.message, e.stack); -- cgit v1.2.3