mirror of
https://github.com/fiatjaf/nak.git
synced 2025-09-01 06:20:46 -04:00
support --auth/--sec/--prompt-sec on req
.
This commit is contained in:
12
helpers.go
12
helpers.go
@@ -109,9 +109,13 @@ func validate32BytesHex(target string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func connectToAllRelays(ctx context.Context, relayUrls []string) (*nostr.SimplePool, []*nostr.Relay) {
|
||||
func connectToAllRelays(
|
||||
ctx context.Context,
|
||||
relayUrls []string,
|
||||
opts ...nostr.PoolOption,
|
||||
) (*nostr.SimplePool, []*nostr.Relay) {
|
||||
relays := make([]*nostr.Relay, 0, len(relayUrls))
|
||||
pool := nostr.NewSimplePool(ctx)
|
||||
pool := nostr.NewSimplePool(ctx, opts...)
|
||||
for _, url := range relayUrls {
|
||||
log("connecting to %s... ", url)
|
||||
if relay, err := pool.EnsureRelay(url); err == nil {
|
||||
@@ -164,7 +168,3 @@ func gatherSecretKeyFromArguments(c *cli.Context) (string, error) {
|
||||
|
||||
return sec, nil
|
||||
}
|
||||
|
||||
func isAuthRequired(msg string) bool {
|
||||
return strings.HasPrefix(msg, "msg: auth-required:")
|
||||
}
|
||||
|
Reference in New Issue
Block a user