From 553b85d2b15c506f7bf1e399030a018e9cf8c45c Mon Sep 17 00:00:00 2001 From: dd dd Date: Sun, 4 Aug 2024 12:48:52 +0200 Subject: [PATCH 1/2] using base10 --- exit/nostr.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/exit/nostr.go b/exit/nostr.go index e0132ed..e4c2600 100644 --- a/exit/nostr.go +++ b/exit/nostr.go @@ -19,9 +19,10 @@ 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(), 20)}, + nostr.Tag{"expiration", strconv.FormatInt(time.Now().Add(time.Second*10).Unix(), 10)}, }, } From 46bb928646263332ab08b0647f93cbc881b2ca5a Mon Sep 17 00:00:00 2001 From: dd dd Date: Sun, 4 Aug 2024 12:49:23 +0200 Subject: [PATCH 2/2] using base10 --- exit/nostr.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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