always recompute the hash when signing.

fixes https://github.com/fiatjaf/nostr-tools/issues/59
This commit is contained in:
fiatjaf
2022-12-23 15:06:20 -03:00
parent f7e510e1c8
commit c0d1e41424

View File

@@ -64,6 +64,6 @@ export function verifySignature(
export async function signEvent(event: Event, key: string): Promise<string> {
return secp256k1.utils.bytesToHex(
await secp256k1.schnorr.sign(event.id || getEventHash(event), key)
await secp256k1.schnorr.sign(getEventHash(event), key)
)
}