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.
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-
lontivero commented at 7:13 PM on November 16, 2020: contributor
-
d355a302d9
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.
-
sipa commented at 7:24 PM on November 16, 2020: member
utACK d355a302d9b7e4aaac04edaa0671ced3b3eaef45
- hebasto approved
-
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.
-
jonatack commented at 7:54 PM on November 16, 2020: member
ACK d355a302d9b7e4aaac04edaa0671ced3b3eaef45
-
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! :)
- DrahtBot added the label P2P on Nov 16, 2020
- 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 - fanquake merged this on Nov 17, 2020
- fanquake closed this on Nov 17, 2020
- MarcoFalke added the label Refactoring on Nov 17, 2020
- sidhujag referenced this in commit 50d2e5ddc3 on Nov 17, 2020
- PastaPastaPasta referenced this in commit 525033efb2 on Jun 27, 2021
- PastaPastaPasta referenced this in commit ea2457dd18 on Jun 28, 2021
- PastaPastaPasta referenced this in commit 0cca0ba4f7 on Jun 29, 2021
- PastaPastaPasta referenced this in commit 80ce5596f0 on Jul 1, 2021
- PastaPastaPasta referenced this in commit ac1b8c1e62 on Jul 1, 2021
- PastaPastaPasta referenced this in commit 5eff25cfa6 on Jul 15, 2021
- PastaPastaPasta referenced this in commit 2e877c6ce5 on Jul 15, 2021
- PastaPastaPasta referenced this in commit f2f4a8f085 on Jul 16, 2021
- gabriel-bjg referenced this in commit 305dc5feed on Jul 16, 2021
- Fabcien referenced this in commit 2ed0e4c815 on Dec 23, 2021
- DrahtBot locked this on Feb 15, 2022
Contributors
Labels