aboutsummaryrefslogtreecommitdiffstats
path: root/routes/invoices.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2020-10-11 01:12:37 -0700
committerAdam Soltys <[email protected]>2020-10-11 01:12:37 -0700
commite894563fbf75706649db1b67ecdc4661bb31f9c2 (patch)
tree8a5f8350f18d2fcfe36988b8c468d2b5fb749d42 /routes/invoices.js
parent8b5df12518f245b8e29871a4a71d5bbcee172ce8 (diff)
downloadcoinos-server-e894563fbf75706649db1b67ecdc4661bb31f9c2.tar.gz
coinos-server-e894563fbf75706649db1b67ecdc4661bb31f9c2.zip
get maker to check the ask price
Diffstat (limited to 'routes/invoices.js')
-rw-r--r--routes/invoices.js9
1 files changed, 7 insertions, 2 deletions
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);