unify usage and export nostr.IsOlder() helper.
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user