Fix verify signature
This commit is contained in:
+1
-1
@@ -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
@@ -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
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
|
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
|
|||||||
Reference in New Issue
Block a user