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 (
"iter"
"fiatjaf.com/nostr"
"fiatjaf.com/nostr/eventstore/internal"
"go.etcd.io/bbolt"
)
@@ -36,7 +35,7 @@ func (b *BoltBackend) ReplaceEvent(evt nostr.Event) error {
shouldStore := true
for previous := range results {
if internal.IsOlder(previous, evt) {
if nostr.IsOlder(previous, evt) {
if err := b.delete(txn, previous.ID); err != nil {
return fmt.Errorf("failed to delete event %s for replacing: %w", previous.ID, err)
}