Makes the suffix/TLD check case-insensitive when parsing .onion addresses, as is already done for I2P hostnames. With the current code, a name like <addr>.ONION will not be parsed as a Tor address, and will instead fall through to regular hostname resolution.
netaddress: make .onion suffix check case-insensitive #36636
pull jpk68 wants to merge 1 commits into bitcoin:master from jpk68:onion-check changing 2 files +10 −2-
jpk68 commented at 2:18 AM on October 24, 2026: contributor
-
netaddress: make .onion suffix check case-insensitive 0574f096ab
-
DrahtBot commented at 2:19 AM on October 24, 2026: contributor
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--006a51241073e994b41acfe9ec718e94-->
External sites
- Code coverage & benchmarks: https://corecheck.dev/bitcoin/bitcoin/pulls/36636
- Ralph review <img src=https://review.fish.foo/assets/bitcoin/bitcoin/36636.png alt="Ralph review status"> https://git.fish.foo/bitcoin/bitcoin/pulls/36636#author-ralph
<!--021abf342d371248e50ceaed478a90ca-->
Reviews
See the guideline and AI policy for information on the review process.
Type Reviewers ACK vasild, AndreaDiazCorreia, Husteem, winterrdog If your review is incorrectly listed, please copy-paste <code><!--meta-tag:bot-skip--></code> into the comment that the bot should ignore.
<!--5faf32d7da4f0f540f40219e4f7537a3-->
- vasild approved
-
vasild commented at 9:08 AM on October 24, 2026: contributor
ACK 0574f096abf0cfe75501542efe1787679340d3d3
<details> <summary>Show Signature</summary>
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 ACK 0574f096abf0cfe75501542efe1787679340d3d3 -----BEGIN PGP SIGNATURE----- iQRPBAEBCAA5FiEE5k2NRWFNsHVF2czBVN8G9ktVy78FAmrcdTobFIAAAAAABAAO bWFudTIsMi41KzEuMTIsMiwzAAoJEFTfBvZLVcu/dV8f/1vDOoGWU1M0Q8ClJaod UATWwEHNI47tXPISqPpqoqtISp8Kv1MBeSX4GjVZhpDPRcqRdBfMPyC2GigQgiwY OiS8fjwvBsK+28XigejMSd4vWJdxUpzLBv8lsZaCDeGLWDirVEbPTdbWYKF47A4G IE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ntXm4jTr/oBG9VLGi/ 3OZt/2kd1Sy6QRYRw7/FQ6MkYRGhIGdJmfURRTtDZGO6ma6Z4znPAtU7KBK6mvP1 fJWg3LJiLYPHLn1JnVPR556g6QhUEHY2kIQodYb8qMSwRgJVH3n+ASB0+D/P8eaw 0r4= =f7eZ -----END PGP SIGNATURE-----vasild's public key is on openpgp.org
</details>
-
AndreaDiazCorreia commented at 1:24 PM on October 25, 2026: none
ACK 0574f096abf0cfe75501542efe1787679340d3d3
Built and ran net_tests, netbase_tests, and base32_tests successfully. Confirmed the new test fails with the parent’s netaddress.cpp.
-
Husteem commented at 6:08 PM on October 26, 2026: none
ACK 0574f09
One non-blocking nit
ToLower(addr.substr(...))creates a temporarystd::string(though 6 chars fits within SSO). UsingCaseInsensitiveEqual(addr.substr(addr.size() - suffix.size()), suffix)fromutil/strencodings.havoids the temporary string entirely. It would be nice to use that here (and similarly in SetI2P()) for consistency, -
winterrdog commented at 10:12 PM on October 26, 2026: contributor
tested ACK 0574f096abf0cfe75501542efe1787679340d3d3
successfully built and tested on: Windows
10/MSVC19.51.36257/x86_64. changes LGTM and the intent is pragmatic