Catch failure to verify events

This commit is contained in:
Jon Staab
2024-02-09 14:06:01 -08:00
parent 7cb792ba17
commit 4a0ae3770e
2 changed files with 8 additions and 2 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "paravel", "name": "paravel",
"version": "0.4.18", "version": "0.4.19",
"description": "Yet another toolkit for nostr", "description": "Yet another toolkit for nostr",
"author": "hodlbod", "author": "hodlbod",
"license": "MIT", "license": "MIT",
+7 -1
View File
@@ -82,7 +82,13 @@ export const hasValidSignature = cached<string, boolean, [Event]>({
return 'invalid' return 'invalid'
} }
}, },
getValue: ([e]: [Event]) => verifyEvent(e), getValue: ([e]: [Event]) => {
try {
return verifyEvent(e)
} catch (err) {
return false
}
},
}) })
// ========================================================================== // ==========================================================================