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

@@ -10,7 +10,6 @@ import (
"fiatjaf.com/nostr"
"fiatjaf.com/nostr/eventstore"
"fiatjaf.com/nostr/eventstore/internal"
)
var _ eventstore.Store = (*SliceStore)(nil)
@@ -134,7 +133,7 @@ func (b *SliceStore) 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.delete(previous.ID); err != nil {
return fmt.Errorf("failed to delete event for replacing: %w", err)
}