aboutsummaryrefslogtreecommitdiff
path: root/src/net.h
diff options
context:
space:
mode:
authorAndrew Chow <github@achow101.com>2023-09-21 11:25:31 -0400
committerAndrew Chow <github@achow101.com>2023-09-21 11:26:16 -0400
commit41cb17fdb656c806e54a8410c7f24c78278d9e6f (patch)
tree5202e8c57ce93760f660ce5900995636e9a01e57 /src/net.h
parent5027d41988d4a92be5a9fc846a680e805fc71383 (diff)
parent4ecfd3eaf434d868455466e001adae4b68515ab8 (diff)
downloadbitcoin-41cb17fdb656c806e54a8410c7f24c78278d9e6f.tar.xz
Merge bitcoin/bitcoin#28078: net, refactor: remove unneeded exports, use helpers over low-level code, use optional
4ecfd3eaf434d868455466e001adae4b68515ab8 Inline short, often-called, rarely-changed basic CNetAddr getters (Jon Atack) 5316ae5dd8d90623f9bb883bb253fa6463ee4d34 Convert GetLocal() to std::optional and remove out-param (Jon Atack) f1304db136bbeac70b52522b5a4522165bfb3fc0 Use higher-level CNetAddr and CNode helpers in net.cpp (Jon Atack) 07f589158835151a7613e4b2a508c0dd61a18fd7 Add CNetAddr::IsPrivacyNet() and CNode::IsConnectedThroughPrivacyNet() (Jon Atack) df488563b280c63f5d74d5ac0fcb1a2cad489d55 GetLocal() type-safety, naming, const, and formatting cleanups (stickies-v) fb4265747c9eb022d80c6f2988e574c689130348 Add and use CNetAddr::HasCJDNSPrefix() helper (Jon Atack) 5ba73cd0ee1e661ec4d041ac8ae7a60cfd31f0c0 Move GetLocal() declaration from header to implementation (Jon Atack) 11426f6557ac09489d5e13bf3b9d94fbd5073c8e Move CaptureMessageToFile() declaration from header to implementation (Jon Atack) deccf1c4848620cfff2a9642c5a6b5acdfbc33bd Move IsPeerAddrLocalGood() declaration from header to implementation (Jon Atack) Pull request description: and other improvements noticed while reviewing #27411. Addresses https://github.com/bitcoin/bitcoin/pull/27411#discussion_r1263969104 and https://github.com/bitcoin/bitcoin/pull/27411#discussion_r1263967598. See commit messages for details. ACKs for top commit: achow101: ACK 4ecfd3eaf434d868455466e001adae4b68515ab8 vasild: ACK 4ecfd3eaf434d868455466e001adae4b68515ab8 stickies-v: ACK 4ecfd3eaf434d868455466e001adae4b68515ab8 Tree-SHA512: d792bb2cb24690aeae9bedf97e92b64fb6fd080c39385a4bdb8ed05f37f3134d85bda99da025490829c03017fd56382afe7951cdd039aede1c08ba98fb1aa7f9
Diffstat (limited to 'src/net.h')
-rw-r--r--src/net.h11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/net.h b/src/net.h
index 145b5cf666..5ab693876c 100644
--- a/src/net.h
+++ b/src/net.h
@@ -151,7 +151,6 @@ enum
LOCAL_MAX
};
-bool IsPeerAddrLocalGood(CNode *pnode);
/** Returns a local address that we should advertise to this peer. */
std::optional<CService> GetLocalAddrForPeer(CNode& node);
@@ -170,7 +169,6 @@ bool AddLocal(const CNetAddr& addr, int nScore = LOCAL_NONE);
void RemoveLocal(const CService& addr);
bool SeenLocal(const CService& addr);
bool IsLocal(const CService& addr);
-bool GetLocal(CService& addr, const CNode& peer);
CService GetLocalAddress(const CNode& peer);
CService MaybeFlipIPv6toCJDNS(const CService& service);
@@ -834,6 +832,9 @@ public:
*/
Network ConnectedThroughNetwork() const;
+ /** Whether this peer connected through a privacy network. */
+ [[nodiscard]] bool IsConnectedThroughPrivacyNet() const;
+
// We selected peer as (compact blocks) high-bandwidth peer (BIP152)
std::atomic<bool> m_bip152_highbandwidth_to{false};
// Peer selected us as (compact blocks) high-bandwidth peer (BIP152)
@@ -1575,12 +1576,6 @@ private:
friend struct ConnmanTestMsg;
};
-/** Dump binary message to file, with timestamp */
-void CaptureMessageToFile(const CAddress& addr,
- const std::string& msg_type,
- Span<const unsigned char> data,
- bool is_incoming);
-
/** Defaults to `CaptureMessageToFile()`, but can be overridden by unit tests. */
extern std::function<void(const CAddress& addr,
const std::string& msg_type,