From 82275e4b9e09c8f60cba4badf7c856696474f8a9 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Sun, 22 Mar 2026 17:17:28 -0300 Subject: [PATCH] when parsing a nip05 as a pubkey there is no point in falling back to parsing as hex or npub. --- helpers.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/helpers.go b/helpers.go index d9c3683..7051abe 100644 --- a/helpers.go +++ b/helpers.go @@ -491,15 +491,14 @@ func askConfirmation(msg string) bool { } func parsePubKey(value string) (nostr.PubKey, error) { - // try nip05 first if nip05.IsValidIdentifier(value) { ctx, cancel := context.WithTimeout(context.Background(), time.Second*3) pp, err := nip05.QueryIdentifier(ctx, value) cancel() - if err == nil { - return pp.PublicKey, nil + if err != nil { + return nostr.ZeroPK, err } - // if nip05 fails, fall through to try as pubkey + return pp.PublicKey, nil } pk, err := nostr.PubKeyFromHex(value)