p2p: avoid calculating onion address checksum when version is not 3 #20405

pull lontivero wants to merge 1 commits into bitcoin:master from lontivero:tinyrefactoring changing 1 files +5 −1
  1. lontivero commented at 7:13 PM on November 16, 2020: contributor

    Currently when parsing an onion v3 address the pubic key checksum is calculated in order to compare it with the received address checksum. However this step is not necessary if the address version byte is not 3, in which case the method can return with false immediately.

  2. Break circuit earlier
    There is no need to calculate the full checksum for an Tor v3 onion
    address if the version byte is not the expected one.
    d355a302d9
  3. sipa commented at 7:24 PM on November 16, 2020: member

    utACK d355a302d9b7e4aaac04edaa0671ced3b3eaef45

  4. hebasto approved
  5. hebasto commented at 7:29 PM on November 16, 2020: member

    ACK d355a302d9b7e4aaac04edaa0671ced3b3eaef45, I have reviewed the code and it looks OK, I agree it can be merged.

  6. jonatack commented at 7:54 PM on November 16, 2020: member

    ACK d355a302d9b7e4aaac04edaa0671ced3b3eaef45

  7. practicalswift commented at 8:40 PM on November 16, 2020: contributor

    ACK d355a302d9b7e4aaac04edaa0671ced3b3eaef45 -- patch looks correct

    Neat first-time contribution @lontivero. Warm welcome as a contributor! :)

  8. DrahtBot added the label P2P on Nov 16, 2020
  9. fanquake renamed this:
    Avoid calculating onion address checksum when version is not 3
    p2p: avoid calculating onion address checksum when version is not 3
    on Nov 17, 2020
  10. fanquake merged this on Nov 17, 2020
  11. fanquake closed this on Nov 17, 2020

  12. MarcoFalke added the label Refactoring on Nov 17, 2020
  13. sidhujag referenced this in commit 50d2e5ddc3 on Nov 17, 2020
  14. PastaPastaPasta referenced this in commit 525033efb2 on Jun 27, 2021
  15. PastaPastaPasta referenced this in commit ea2457dd18 on Jun 28, 2021
  16. PastaPastaPasta referenced this in commit 0cca0ba4f7 on Jun 29, 2021
  17. PastaPastaPasta referenced this in commit 80ce5596f0 on Jul 1, 2021
  18. PastaPastaPasta referenced this in commit ac1b8c1e62 on Jul 1, 2021
  19. PastaPastaPasta referenced this in commit 5eff25cfa6 on Jul 15, 2021
  20. PastaPastaPasta referenced this in commit 2e877c6ce5 on Jul 15, 2021
  21. PastaPastaPasta referenced this in commit f2f4a8f085 on Jul 16, 2021
  22. gabriel-bjg referenced this in commit 305dc5feed on Jul 16, 2021
  23. Fabcien referenced this in commit 2ed0e4c815 on Dec 23, 2021
  24. DrahtBot locked this on Feb 15, 2022

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-04-14 00:14 UTC

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