diff options
| -rw-r--r-- | lib/app.ts | 1 | ||||
| -rw-r--r-- | lib/utils.ts | 9 | ||||
| -rw-r--r-- | routes/nostr.ts | 4 | ||||
| -rw-r--r-- | routes/payments.ts | 3 |
4 files changed, 9 insertions, 8 deletions
@@ -16,6 +16,7 @@ import { jwtStrategy } from "$lib/auth"; const app = fastify({ logger: pino(), disableRequestLogging: true, + // disableRequestLogging: false, maxParamLength: 500, }); diff --git a/lib/utils.ts b/lib/utils.ts index 7bcb4a3d..b7f55ff1 100644 --- a/lib/utils.ts +++ b/lib/utils.ts @@ -170,12 +170,13 @@ export function formatReceipt(items, currency) { export let t = ({ language = "en" }) => locales[language]; export let time = (() => { - let count = 0, started = false; - return () => { + let count = 0, + started = false; + return (s = "") => { if (!started) { - console.time(''); + console.time(""); started = true; } - console.timeLog('', ++count); + console.timeLog("", ++count, s); }; })(); diff --git a/routes/nostr.ts b/routes/nostr.ts index 3f217c39..2ed0d65f 100644 --- a/routes/nostr.ts +++ b/routes/nostr.ts @@ -1,5 +1,5 @@ import config from "$config"; -import { bail, fail, getUser } from "$lib/utils"; +import { bail, fail, getUser, time } from "$lib/utils"; import { g, s, db } from "$lib/db"; import { anon, @@ -62,7 +62,7 @@ export default { let filter = { kinds: [3], authors: [pubkey] }; let ev = await pool.get([config.nostr], filter, opts); - if (!ev || tagsonly) { + if (!ev) { let { relays } = config; ({ write: relays } = await getRelays(pubkey)); diff --git a/routes/payments.ts b/routes/payments.ts index fdeecde6..93b9832e 100644 --- a/routes/payments.ts +++ b/routes/payments.ts @@ -449,11 +449,10 @@ export default { let { id } = await ln.getinfo(); let p; - if (payee === id){ + if (payee === id) { p = await debit({ hash: pr, amount, memo, user }); await credit({ hash: pr, amount, memo, ref: user.id }); } else p = await sendLightning({ user, pr, amount, maxfee, memo }); - res.send(p); } catch (e) { |
