diff --git a/p2p/dnsdisc/tree.go b/p2p/dnsdisc/tree.go index 8329e6667..0c47edf94 100644 --- a/p2p/dnsdisc/tree.go +++ b/p2p/dnsdisc/tree.go @@ -311,11 +311,11 @@ func parseLink(e string) (*linkEntry, error) { return nil, fmt.Errorf("wrong/missing scheme 'enrtree' in URL") } e = e[len(linkPrefix):] - pos := strings.IndexByte(e, '@') - if pos == -1 { + keystring, domain, ok := strings.Cut(e, "@") + if !ok { return nil, entryError{"link", errNoPubkey} } - keystring, domain := e[:pos], e[pos+1:] + keybytes, err := b32format.DecodeString(keystring) if err != nil { return nil, entryError{"link", errBadPubkey}