HomePhabricator

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

Description

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

Summary:
There is no need to calculate the full checksum for an Tor v3 onion address if the version byte is not the expected one.

This is a backport of core#20405

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D10733

Details

Provenance
lontivero <lucasontivero@gmail.com>Authored on Nov 16 2020, 18:54
PiRKCommitted on Dec 23 2021, 13:51
PiRKPushed on Dec 23 2021, 13:51
Reviewer
Restricted Project
Differential Revision
D10733: p2p: avoid calculating onion address checksum when version is not 3
Parents
rABCdf99eb6da0e8: refactor: use constexpr and remove template
Branches
Unknown
Tags
Unknown