unify usage and export nostr.IsOlder() helper.

This commit is contained in:
fiatjaf
2026-01-22 22:54:44 -03:00
parent f1fdb0788a
commit 0cb0d1ccb0
9 changed files with 16 additions and 25 deletions

View File

@@ -5,7 +5,6 @@ import (
"fiatjaf.com/nostr"
"fiatjaf.com/nostr/eventstore"
"fiatjaf.com/nostr/eventstore/internal"
)
func (b *BleveBackend) ReplaceEvent(evt nostr.Event) error {
@@ -19,7 +18,7 @@ func (b *BleveBackend) ReplaceEvent(evt nostr.Event) error {
shouldStore := true
for previous := range b.QueryEvents(filter, 1) {
if internal.IsOlder(previous, evt) {
if nostr.IsOlder(previous, evt) {
if err := b.DeleteEvent(previous.ID); err != nil {
return fmt.Errorf("failed to delete event for replacing: %w", err)
}