diff options
| author | Adam Soltys <[email protected]> | 2024-10-10 20:31:37 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2024-10-10 20:31:37 -0700 |
| commit | 2de34e3324e9ede75740b2e4beb984676623795d (patch) | |
| tree | 364733891949e4ac1b8ea53a32ea2f97cb7dd7dd | |
| parent | 9edc16aa2d56ab5039cfb29cdfc1292da0ed6290 (diff) | |
| download | coinos-server-2de34e3324e9ede75740b2e4beb984676623795d.tar.gz coinos-server-2de34e3324e9ede75740b2e4beb984676623795d.zip | |
check relay tags
| -rw-r--r-- | lib/nostr.ts | 1 | ||||
| -rw-r--r-- | routes/nostr.ts | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/lib/nostr.ts b/lib/nostr.ts index 40dfc5f6..1fcea5c3 100644 --- a/lib/nostr.ts +++ b/lib/nostr.ts @@ -98,6 +98,7 @@ export let getRelays = async (pubkey): Promise<any> => { read = []; write = []; for (let r of event.tags) { + if (r[0] !== "r") continue; if (!r[2] || r[2] === "write") write.push(r[1]); if (!r[2] || r[2] === "read") read.push(r[1]); } diff --git a/routes/nostr.ts b/routes/nostr.ts index 0230f712..3f217c39 100644 --- a/routes/nostr.ts +++ b/routes/nostr.ts @@ -166,7 +166,7 @@ export default { let { pubkey } = req.params; res.send(await getCount(pubkey)); } catch (e) { - console.log(e) + console.log(e); bail(res, e.message); } }, |
