diff options
| author | Adam Soltys <[email protected]> | 2026-11-25 09:25:18 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-11-25 09:25:18 -0700 |
| commit | 43b6d2a4e16f1991a02a77f2198bc83bb71deb04 (patch) | |
| tree | 78f9f0c59ccd83b5e3e797ef2a1bd082e982de47 /routes | |
| parent | e0ac891b4c3275b5bb228fd53b507d1c61ff88ea (diff) | |
| download | coinos-server-43b6d2a4e16f1991a02a77f2198bc83bb71deb04.tar.gz coinos-server-43b6d2a4e16f1991a02a77f2198bc83bb71deb04.zip | |
names: ignore registrar records held by blocked keys
Names whose v3 record belongs to a key in names:blocked_holders are treated
as unclaimed: lightning address, NIP-05 and legacy forwarding stay with the
local account. Fails open if the registrar or db cannot answer.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VMan6SEnsbshZrUDtTsxAX
Diffstat (limited to 'routes')
| -rw-r--r-- | routes/lnurl.ts | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/routes/lnurl.ts b/routes/lnurl.ts index e28bb510..20d795c0 100644 --- a/routes/lnurl.ts +++ b/routes/lnurl.ts @@ -37,6 +37,8 @@ const unauthInvoiceBudget = async (uid: string) => { fail("Too many payment requests for this user, try again later"); } }; +import { holderBlocked } from "$lib/names"; + // v3 payment addresses (coinos v3 / halwallet) are registered here. const NAMES_URL = process.env.NAMES_URL || "https://names.coinos.io"; @@ -135,7 +137,7 @@ export default { // registrar never queries this endpoint for those. If the registrar is // unreachable we fall through and serve the local account — a briefly // stale destination beats an unpayable address. - const v3 = await registrarLookup(name); + const v3 = (await holderBlocked(name)) ? null : await registrarLookup(name); if (v3) return res.send(v3); const user = await getUser(name); |
