diff options
author | Jon Atack <jon@atack.com> | 2023-07-19 11:11:06 -0600 |
---|---|---|
committer | Jon Atack <jon@atack.com> | 2023-07-19 12:40:45 -0600 |
commit | 07f589158835151a7613e4b2a508c0dd61a18fd7 (patch) | |
tree | 3944a71beca6c9c80ee906617cdaede296c3ae65 /src/netaddress.h | |
parent | df488563b280c63f5d74d5ac0fcb1a2cad489d55 (diff) | |
download | bitcoin-07f589158835151a7613e4b2a508c0dd61a18fd7.tar.xz |
Add CNetAddr::IsPrivacyNet() and CNode::IsConnectedThroughPrivacyNet()
Co-authored-by: Vasil Dimov <vd@FreeBSD.org>
Diffstat (limited to 'src/netaddress.h')
-rw-r--r-- | src/netaddress.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/netaddress.h b/src/netaddress.h index 5e67d843e2..428ab87423 100644 --- a/src/netaddress.h +++ b/src/netaddress.h @@ -189,6 +189,13 @@ public: bool IsValid() const; /** + * Whether this object is a privacy network. + * TODO: consider adding IsCJDNS() here when more peers adopt CJDNS, see: + * https://github.com/bitcoin/bitcoin/pull/27411#issuecomment-1497176155 + */ + [[nodiscard]] bool IsPrivacyNet() const { return IsTor() || IsI2P(); } + + /** * Check if the current object can be serialized in pre-ADDRv2/BIP155 format. */ bool IsAddrV1Compatible() const; |