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
  1. jpk68 commented at 2:18 AM on October 24, 2026: contributor

    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.

  2. netaddress: make .onion suffix check case-insensitive 0574f096ab
  3. 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

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline and AI policy for information on the review process.

    If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  4. vasild approved
  5. 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
    IE5K3PunX7kUaRGOz/pE/NEVyLvE4L715SMstp2imx3Srnnw48XZmFekAU7jUG8M
    HJcX2g1K3X58P77vwsYv2LyXJlWkZ5FejcwBYg2we5YCQGjNEEtDrd7/knmw1bx9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LJiLYPHLn1JnVPR556g6QhUEHY2kIQodYb8qMSwRgJVH3n+ASB0+D/P8eaw
    0r4=
    =f7eZ
    -----END PGP SIGNATURE-----
    

    vasild's public key is on openpgp.org

    </details>

  6. 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.

  7. Husteem commented at 6:08 PM on October 26, 2026: none

    ACK 0574f09

    One non-blocking nit ToLower(addr.substr(...)) creates a temporary std::string (though 6 chars fits within SSO). Using CaseInsensitiveEqual(addr.substr(addr.size() - suffix.size()), suffix) from util/strencodings.h avoids the temporary string entirely. It would be nice to use that here (and similarly in SetI2P()) for consistency,

  8. winterrdog commented at 10:12 PM on October 26, 2026: contributor

    tested ACK 0574f096abf0cfe75501542efe1787679340d3d3

    successfully built and tested on: Windows 10/MSVC 19.51.36257/x86_64. changes LGTM and the intent is pragmatic

  9. sedited approved
  10. sedited commented at 8:24 PM on November 3, 2026: contributor

    ACK 0574f096abf0cfe75501542efe1787679340d3d3

  11. sedited merged this on Nov 3, 2026
  12. sedited closed this on Nov 3, 2026

  13. numair referenced this in commit 9233bb56fa on Nov 15, 2026
  14. jpk68 deleted the branch on Nov 20, 2026

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-12-05 04:51 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me