aboutsummaryrefslogtreecommitdiffstats
path: root/routes/lightning/channel.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2022-09-02 14:47:08 -0700
committerAdam Soltys <[email protected]>2022-09-02 14:47:14 -0700
commit3161dd7ee95b6c7d70f8341298dd4fab84cda8b0 (patch)
tree16cd6c55d5dc481331b1e8b640d179f193e7ea13 /routes/lightning/channel.js
parent7a8d64833de8873afb92982b3f5bfff59b30c542 (diff)
downloadcoinos-server-3161dd7ee95b6c7d70f8341298dd4fab84cda8b0.tar.gz
coinos-server-3161dd7ee95b6c7d70f8341298dd4fab84cda8b0.zip
es6 migration
Diffstat (limited to 'routes/lightning/channel.js')
-rw-r--r--routes/lightning/channel.js16
1 files changed, 8 insertions, 8 deletions
diff --git a/routes/lightning/channel.js b/routes/lightning/channel.js
index fe6d9520..168f55ab 100644
--- a/routes/lightning/channel.js
+++ b/routes/lightning/channel.js
@@ -1,6 +1,6 @@
-import axios from 'axios';
+import axios from "axios";
-export default ah(async (req, res) => {
+export default async (req, res) => {
const { params } = req.body;
const [pubkey, host] = params.uri.split("@");
@@ -12,7 +12,7 @@ export default ah(async (req, res) => {
perm: true
});
} catch (e) {
- if (!e.message.includes('already connected')) {
+ if (!e.message.includes("already connected")) {
l.error("problem connecting to peer", e.message);
return res.status(500).send(e.message);
}
@@ -22,18 +22,18 @@ export default ah(async (req, res) => {
let remoteid;
try {
remoteid = (await lnp.getInfo({})).identity_pubkey;
- } catch(e) {
+ } catch (e) {
l.error("problem getting lightning node info", e.message);
return res.status(500).send(e.message);
- }
+ }
let url = `${callback}?k1=${k1}&remoteid=${remoteid}&private=0`;
try {
let response = await axios.get(url);
res.send(response.data);
- } catch(e) {
+ } catch (e) {
l.error("problem sending channel request", e.message);
return res.status(500).send({ status: "ERROR", reason: e.message });
- }
-});
+ }
+};