use ErrDupEvent from eventstore instead of our own.

This commit is contained in:
fiatjaf 2023-11-07 14:36:13 -03:00
parent a15cd4e545
commit 1e51cdbc07
No known key found for this signature in database
GPG Key ID: BAD43C4BE5C1A3A1
2 changed files with 2 additions and 6 deletions

View File

@ -4,6 +4,7 @@ import (
"context"
"fmt"
"github.com/fiatjaf/eventstore"
"github.com/nbd-wtf/go-nostr"
)
@ -66,7 +67,7 @@ func (rl *Relay) AddEvent(ctx context.Context, evt *nostr.Event) error {
for _, store := range rl.StoreEvent {
if saveErr := store(ctx, evt); saveErr != nil {
switch saveErr {
case ErrDupEvent:
case eventstore.ErrDupEvent:
return nil
default:
errmsg := saveErr.Error()

View File

@ -1,5 +0,0 @@
package khatru
import "fmt"
var ErrDupEvent = fmt.Errorf("duplicate: event already exists")