diff --git a/exit/nostr.go b/exit/nostr.go index e4c2600..8864092 100644 --- a/exit/nostr.go +++ b/exit/nostr.go @@ -10,6 +10,8 @@ import ( "github.com/nbd-wtf/go-nostr" ) +const ten = 10 + func (e *Exit) announceExitNode(ctx context.Context) error { if !e.config.Public { return nil @@ -19,13 +21,11 @@ func (e *Exit) announceExitNode(ctx context.Context) error { event := nostr.Event{ PubKey: e.publicKey, CreatedAt: nostr.Now(), - - Kind: protocol.KindAnnouncementEvent, + Kind: protocol.KindAnnouncementEvent, Tags: nostr.Tags{ - nostr.Tag{"expiration", strconv.FormatInt(time.Now().Add(time.Second*10).Unix(), 10)}, + nostr.Tag{"expiration", strconv.FormatInt(time.Now().Add(time.Second*ten).Unix(), ten)}, }, } - err := event.Sign(e.config.NostrPrivateKey) if err != nil { slog.Error("could not sign event", "error", err) @@ -39,7 +39,7 @@ func (e *Exit) announceExitNode(ctx context.Context) error { // do not return here, try to publish the event to other relays } } - time.Sleep(time.Second * 10) + time.Sleep(time.Second * ten) } }() return nil