Fix verify signature

This commit is contained in:
Jon Staab
2023-12-15 14:59:23 -08:00
parent 03c2c369f5
commit 2a402f1190
2 changed files with 2 additions and 10 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "paravel", "name": "paravel",
"version": "0.4.15", "version": "0.4.16",
"description": "Yet another toolkit for nostr", "description": "Yet another toolkit for nostr",
"author": "hodlbod", "author": "hodlbod",
"license": "MIT", "license": "MIT",
+1 -9
View File
@@ -76,15 +76,7 @@ export const createEvent = (kind: number, {content = "", tags = [], created_at =
export const hasValidSignature = cached<string, boolean, [Event]>({ export const hasValidSignature = cached<string, boolean, [Event]>({
maxSize: 10000, maxSize: 10000,
getKey: ([e]: [Event]) => [getEventHash(e), e.sig].join(":"), getKey: ([e]: [Event]) => [getEventHash(e), e.sig].join(":"),
getValue: ([e]: [Event]) => { getValue: ([e]: [Event]) => verifySignature(e),
try {
verifySignature(e)
} catch (e) {
return false
}
return true
},
}) })
// ========================================================================== // ==========================================================================