mirror of
https://github.com/nbd-wtf/nostr-tools.git
synced 2025-12-08 16:28:49 +00:00
always add event.id
This commit is contained in:
3
pool.js
3
pool.js
@@ -95,11 +95,12 @@ export function relayPool(globalPrivateKey) {
|
||||
if (index !== -1) noticeCallbacks.splice(index, 1)
|
||||
},
|
||||
async publish(event, statusCallback = (status, relayURL) => {}) {
|
||||
event.id = await getEventHash(event)
|
||||
|
||||
if (!event.sig) {
|
||||
event.tags = event.tags || []
|
||||
|
||||
if (globalPrivateKey) {
|
||||
event.id = await getEventHash(event)
|
||||
event.sig = await signEvent(event, globalPrivateKey)
|
||||
} else {
|
||||
throw new Error(
|
||||
|
||||
Reference in New Issue
Block a user