mirror of
https://github.com/nbd-wtf/nostr-tools.git
synced 2025-12-09 00:28:51 +00:00
always recompute the hash when signing.
fixes https://github.com/fiatjaf/nostr-tools/issues/59
This commit is contained in:
2
event.ts
2
event.ts
@@ -64,6 +64,6 @@ export function verifySignature(
|
|||||||
|
|
||||||
export async function signEvent(event: Event, key: string): Promise<string> {
|
export async function signEvent(event: Event, key: string): Promise<string> {
|
||||||
return secp256k1.utils.bytesToHex(
|
return secp256k1.utils.bytesToHex(
|
||||||
await secp256k1.schnorr.sign(event.id || getEventHash(event), key)
|
await secp256k1.schnorr.sign(getEventHash(event), key)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user