badger: fix logic for checking if an event id exists.

This commit is contained in:
fiatjaf
2023-11-06 13:42:47 -03:00
parent 02e05e2935
commit 9a0b75313b
2 changed files with 2 additions and 0 deletions

View File

@@ -19,6 +19,7 @@ func (b *BadgerBackend) DeleteEvent(ctx context.Context, evt *nostr.Event) error
// query event by id to get its idx
id, _ := hex.DecodeString(evt.ID)
prefix := make([]byte, 1+32)
prefix[0] = indexIdPrefix
copy(prefix[1:], id)
opts := badger.DefaultIteratorOptions
opts.PrefetchValues = false