diff options
| author | Adam Soltys <[email protected]> | 2023-02-21 16:28:00 +0000 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2023-02-21 16:28:00 +0000 |
| commit | ba755998e6a70a327c6c3617927e3f025b8fb222 (patch) | |
| tree | 214c6a9e3874fc47942c32c2d7ce513d3a2e1ddf | |
| parent | cc957a0e16027567ef93902dcae9abe0c5e4bfb4 (diff) | |
| download | coinos-server-ba755998e6a70a327c6c3617927e3f025b8fb222.tar.gz coinos-server-ba755998e6a70a327c6c3617927e3f025b8fb222.zip | |
respect address type
| -rw-r--r-- | docker-compose.yml | 4 | ||||
| -rw-r--r-- | routes/invoices.js | 2 | ||||
| -rw-r--r-- | routes/lnurl.js | 23 |
3 files changed, 3 insertions, 26 deletions
diff --git a/docker-compose.yml b/docker-compose.yml index 5ae74b03..3c655387 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,10 +9,8 @@ services: container_name: clapp image: gcr.io/coinos-326717/github.com/coinos/coinos-server:prod restart: always - command: "pnpm dev" environment: - # NODE_ENV: production - NODE_ENV: development + NODE_ENV: production NODE_OPTIONS: "--es-module-specifier-resolution=node --experimental-modules --loader ./loader.js --openssl-legacy-provider" HOSTNAME: "${HOSTNAME}" volumes: diff --git a/routes/invoices.js b/routes/invoices.js index 338c66e7..91df20ac 100644 --- a/routes/invoices.js +++ b/routes/invoices.js @@ -110,7 +110,7 @@ app.post("/invoice", optionalAuth, async (req, res, next) => { address = address; } } else if (network !== "lightning") { - address = await { bitcoin: bc, liquid: lq }[network].getNewAddress(); + address = await { bitcoin: bc, liquid: lq }[network].getNewAddress("", invoice.addressType); if (network === "liquid") ({ unconfidential } = await lq.getAddressInfo(address)); } diff --git a/routes/lnurl.js b/routes/lnurl.js index 1ad7b814..b007bf64 100644 --- a/routes/lnurl.js +++ b/routes/lnurl.js @@ -317,28 +317,7 @@ lnurlServer.bindToHook( async (req, res, next) => { try { let user; - const { amount: msats, key, tag, pr, k1 } = req.query; - - if (msats) { - let amount = Math.round(msats / 1000); - const parts = req.originalUrl.split("/"); - const secret = parts[parts.length - 1].split("?")[0]; - let user_id = lnurlPayments[secret]; - - if (user_id) { - let account = await db.Account.findOne({ - where: { - user_id, - asset: config.liquid.btcasset, - pubkey: null - } - }); - - if (account.balance < amount) { - throw new Error("Insufficient funds"); - } - } - } + const { key, tag, pr, k1 } = req.query; if (tag === "login") { let username = logins[k1]; |
