mirror of
https://github.com/asmogo/nws.git
synced 2025-01-05 20:30:09 +00:00
Merge pull request #31 from asmogo/fix_format_int_base
Fix format int base
This commit is contained in:
commit
cba0f16b01
@ -10,6 +10,8 @@ import (
|
|||||||
"github.com/nbd-wtf/go-nostr"
|
"github.com/nbd-wtf/go-nostr"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const ten = 10
|
||||||
|
|
||||||
func (e *Exit) announceExitNode(ctx context.Context) error {
|
func (e *Exit) announceExitNode(ctx context.Context) error {
|
||||||
if !e.config.Public {
|
if !e.config.Public {
|
||||||
return nil
|
return nil
|
||||||
@ -21,10 +23,9 @@ func (e *Exit) announceExitNode(ctx context.Context) error {
|
|||||||
CreatedAt: nostr.Now(),
|
CreatedAt: nostr.Now(),
|
||||||
Kind: protocol.KindAnnouncementEvent,
|
Kind: protocol.KindAnnouncementEvent,
|
||||||
Tags: nostr.Tags{
|
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*ten).Unix(), ten)},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
err := event.Sign(e.config.NostrPrivateKey)
|
err := event.Sign(e.config.NostrPrivateKey)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
slog.Error("could not sign event", "error", err)
|
slog.Error("could not sign event", "error", err)
|
||||||
@ -38,7 +39,7 @@ func (e *Exit) announceExitNode(ctx context.Context) error {
|
|||||||
// do not return here, try to publish the event to other relays
|
// do not return here, try to publish the event to other relays
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
time.Sleep(time.Second * 10)
|
time.Sleep(time.Second * ten)
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
return nil
|
return nil
|
||||||
|
Loading…
Reference in New Issue
Block a user