diff options
| author | Adam Soltys <[email protected]> | 2023-02-22 19:23:02 +0000 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2023-02-22 19:23:07 +0000 |
| commit | 753147ba339bc335443f9ed3a9f03eb492df1f7b (patch) | |
| tree | c077a32874c15c901d15f49ca8ae027d77963f21 | |
| parent | dc38913797c587499926ed292d296dcbf44ee627 (diff) | |
| download | coinos-server-753147ba339bc335443f9ed3a9f03eb492df1f7b.tar.gz coinos-server-753147ba339bc335443f9ed3a9f03eb492df1f7b.zip | |
log lnurl lookup failure
| -rw-r--r-- | routes/lnurl.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/routes/lnurl.js b/routes/lnurl.js index 8d45d301..381b3008 100644 --- a/routes/lnurl.js +++ b/routes/lnurl.js @@ -1,5 +1,5 @@ import { g, s } from "$lib/db"; -import { l } from "$lib/logging"; +import { l, warn } from "$lib/logging"; import { bail, fail } from "$lib/utils"; import { v4 } from "uuid"; import got from "got"; @@ -19,12 +19,14 @@ export default { async encode({ query: { address } }, res) { let [name, domain] = address.split("@"); let url = `https://${domain}/.well-known/lnurlp/${name}`; - + try { let r = await got(url).json(); if (r.tag !== "payRequest") fail("not an ln address"); } catch (e) { - return bail(res, "failed to lookup lightning address"); + let m = `failed to lookup lightning address ${address}`; + warn(m); + return bail(res, m); } let enc = bech32.encode("lnurl", bech32.toWords(Buffer.from(url)), 20000); |
