aboutsummaryrefslogtreecommitdiffstats
path: root/routes/liquid
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2020-08-06 20:15:21 -0700
committerAdam Soltys <[email protected]>2020-08-06 20:15:21 -0700
commit2a960a2448c3b936599a933b63a92af5d67273de (patch)
tree20b390a8776abb3446cc85017f2e8e2bc1c1d422 /routes/liquid
parent40fc89ab9b00da0d5928e663c7fde0717b2a96af (diff)
downloadcoinos-server-2a960a2448c3b936599a933b63a92af5d67273de.tar.gz
coinos-server-2a960a2448c3b936599a933b63a92af5d67273de.zip
user exists endpoint
Diffstat (limited to 'routes/liquid')
-rw-r--r--routes/liquid/fee.js15
1 files changed, 11 insertions, 4 deletions
diff --git a/routes/liquid/fee.js b/routes/liquid/fee.js
index b68c4178..77a9ce17 100644
--- a/routes/liquid/fee.js
+++ b/routes/liquid/fee.js
@@ -3,12 +3,19 @@ module.exports = ah(async (req, res) => {
let { address, asset, amount, feeRate } = req.body;
let tx, fee;
- let recipient = await db.User.findOne({
- attributes: ["username"],
- where: { confidential: address },
+ let invoice = await db.Invoice.findOne({
+ where: { address },
+ include: {
+ attributes: ['username'],
+ model: db.User,
+ as: 'user',
+ }
});
- if (recipient) emit(user.username, "to", recipient);
+ if (invoice) {
+ emit(user.username, "to", invoice.user);
+ return res.end();
+ }
try {
if (config.liquid.walletpass)