diff options
author | Jon Atack <jon@atack.com> | 2022-04-01 18:22:53 +0200 |
---|---|---|
committer | Jon Atack <jon@atack.com> | 2022-05-12 17:41:32 +0200 |
commit | 51ec96b904f349056e805c6b2a6de5257e8fbdee (patch) | |
tree | bb3608bab19031f499443cdc64481fe710912441 /src/net.cpp | |
parent | dd9f61a184d4d395591ee3e9f1e839473e88ffd0 (diff) | |
download | bitcoin-51ec96b904f349056e805c6b2a6de5257e8fbdee.tar.xz |
refactor: move StartExtraBlockRelayPeers from header to implementation
where all the other logging actions in src/net.{h,cpp} are located.
StartExtraBlockRelayPeers() does not appear to be a hotspot that needs to be
inlined for performance, as it is called from CheckForStaleTipAndEvictPeers(),
called in turn from StartScheduledTasks() with a scheduleEvery delta of 45
seconds, called at the end of AppInitMain() on bitcoind startup.
This allows dropping `#include <logging.h>` from net.h, which can improve
compile time/speed. Currently, none of the other includes in net.h use
logging.h, except src/sync.h if DEBUG_LOCKCONTENTION is defined.
Diffstat (limited to 'src/net.cpp')
-rw-r--r-- | src/net.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/net.cpp b/src/net.cpp index 41ac31445d..1c775f9a3f 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -1867,6 +1867,12 @@ void CConnman::SetTryNewOutboundPeer(bool flag) LogPrint(BCLog::NET, "net: setting try another outbound peer=%s\n", flag ? "true" : "false"); } +void CConnman::StartExtraBlockRelayPeers() +{ + LogPrint(BCLog::NET, "net: enabling extra block-relay-only peers\n"); + m_start_extra_block_relay_peers = true; +} + // Return the number of peers we have over our outbound connection limit // Exclude peers that are marked for disconnect, or are going to be // disconnected soon (eg ADDR_FETCH and FEELER) |