aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2020-10-12 15:57:46 -0700
committerAdam Soltys <[email protected]>2020-10-12 15:57:46 -0700
commit445a3823f1accb61941d86f5b602639989025255 (patch)
treecf4d71b2cf21df2466cfbe85315af47daa98e448
parent19038304e39f190ea400a50b6c66a671762ee673 (diff)
downloadcoinos-server-445a3823f1accb61941d86f5b602639989025255.tar.gz
coinos-server-445a3823f1accb61941d86f5b602639989025255.zip
return confidentialAddress as well
-rw-r--r--routes/invoices.js20
-rw-r--r--routes/users.js8
2 files changed, 4 insertions, 24 deletions
diff --git a/routes/invoices.js b/routes/invoices.js
index a4fb7be1..3ef0b4e3 100644
--- a/routes/invoices.js
+++ b/routes/invoices.js
@@ -47,26 +47,6 @@ app.post(
invoice.currency
);
- if (invoice.network === "liquid" && !invoice.unconfidential) {
- try {
- const { username, password, port, wallet } = config.liquid;
- const { data: { result } }= await axios.post(
- `http://${username}:${password}@127.0.0.1:${port}/wallet/${wallet}`,
- {
- jsonrpc: "1.0",
- id: "curltext",
- method: "getaddressinfo",
- params: [invoice.address]
- }
- );
-
- invoice.unconfidential = result.unconfidential;
- } catch(e) {
- l.error("problem getting confidential address info", e.message);
- return res.status(500).send("Problem getting confidential address");
- }
- }
-
if (!invoice.tip) invoice.tip = 0;
const exists = await db.Invoice.findOne({
diff --git a/routes/users.js b/routes/users.js
index 6e9678fe..becd8d40 100644
--- a/routes/users.js
+++ b/routes/users.js
@@ -399,7 +399,7 @@ app.get(
"/address",
ah(async (req, res) => {
let { network, type } = req.query;
- let address;
+ let address, confidentialAddress;
type = {
bech32: "p2wpkh",
@@ -460,13 +460,13 @@ app.get(
n
);
- ({ confidentialAddress: address } = p[type]({
+ ({ confidentialAddress } = p[type]({
redeem: p2wpkh,
network: n,
blindkey: blindkey.publicKey
}));
- lq.importBlindingKey(address, blindkey.privateKey.toString('hex'));
+ lq.importBlindingKey(confidentialAddress, blindkey.privateKey.toString('hex'));
} else {
({ address } = p[type]({
redeem: p.p2wpkh({
@@ -478,7 +478,7 @@ app.get(
}
}
- res.send(address);
+ res.send({ address, confidentialAddress });
})
);