diff options
| author | Adam Soltys <[email protected]> | 2020-08-16 21:34:13 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2020-08-16 21:34:13 -0700 |
| commit | 7ab3036cb1576fe38ba1fd423a58b7cd97a58579 (patch) | |
| tree | 305b1a0aa321389b60385009876bbdb1fe0a1c68 /routes/payments.js | |
| parent | b2208797d3c5559c7e8cc7d35b7a020da0c61193 (diff) | |
| download | coinos-server-7ab3036cb1576fe38ba1fd423a58b7cd97a58579.tar.gz coinos-server-7ab3036cb1576fe38ba1fd423a58b7cd97a58579.zip | |
non-custodial liquid wallets
Diffstat (limited to 'routes/payments.js')
| -rw-r--r-- | routes/payments.js | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/routes/payments.js b/routes/payments.js index ca479026..5e7263da 100644 --- a/routes/payments.js +++ b/routes/payments.js @@ -18,19 +18,12 @@ ah(async () => { l.warn("couldn't read exceptions file", e.message); } - await db.User.findAll({ - attributes: ["username", "address", "liquid"], - }).map((u) => { - if (u.address) addresses[u.address] = u.username; - if (u.liquid) addresses[u.liquid] = u.username; - }); - - await db.Invoice.findAll({ + (await db.Invoice.findAll({ include: { model: db.User, as: "user", }, - }).map(({ address, user, unconfidential }) => { + })).map(({ address, user, unconfidential }) => { if (address && user) addresses[address] = user.username; if (unconfidential && user) addresses[unconfidential] = user.username; }); @@ -113,7 +106,11 @@ ah(async () => { if (config.bitcoin) { bc = new BitcoinCore(config.bitcoin); - app.post("/bitcoin/broadcast", optionalAuth, require("./bitcoin/broadcast")); + app.post( + "/bitcoin/broadcast", + optionalAuth, + require("./bitcoin/broadcast") + ); app.get("/bitcoin/generate", auth, require("./bitcoin/generate")); app.post("/bitcoin/sweep", auth, require("./bitcoin/sweep")); app.post("/bitcoin/fee", auth, require("./bitcoin/fee")); @@ -123,6 +120,11 @@ ah(async () => { if (config.liquid) { lq = new BitcoinCore(config.liquid); + app.post( + "/liquid/broadcast", + optionalAuth, + require("./liquid/broadcast") + ); app.get("/liquid/generate", auth, require("./liquid/generate")); app.post("/liquid/fee", auth, require("./liquid/fee")); app.post("/liquid/send", auth, require("./liquid/send")); |
