Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistency in IsOnionV2Address util function #683

Open
mathewhodson opened this issue Jul 2, 2022 · 0 comments
Open

Inconsistency in IsOnionV2Address util function #683

mathewhodson opened this issue Jul 2, 2022 · 0 comments

Comments

@mathewhodson
Copy link
Contributor

The IsOnionV2Address function comments say, "The second-to-the-right most label is a 16 character long, base32." The code actually seems to check the left-most label.

Based on similar code in IsOnionV3Address, the code in IsOnionV2Address should be updated to this:

address := labels[len(labels)-2]
if len(address) != 16 {
	return false
}
_, err := onionBase32Encoding.DecodeString(address)

Originally posted by @mathewhodson in #677 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant