use a single global sdk.System and its Pool.

This commit is contained in:
fiatjaf
2024-09-17 08:09:20 -03:00
parent bd5ca27661
commit 2b5f3355bc
10 changed files with 58 additions and 61 deletions

View File

@@ -8,7 +8,6 @@ import (
"github.com/nbd-wtf/go-nostr"
"github.com/nbd-wtf/go-nostr/nip05"
"github.com/nbd-wtf/go-nostr/nip19"
sdk "github.com/nbd-wtf/nostr-sdk"
)
var fetch = &cli.Command{
@@ -27,8 +26,6 @@ var fetch = &cli.Command{
),
ArgsUsage: "[nip05_or_nip19_code]",
Action: func(ctx context.Context, c *cli.Command) error {
sys := sdk.NewSystem()
defer func() {
sys.Pool.Relays.Range(func(_ string, relay *nostr.Relay) bool {
relay.Close()