aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMacroFake <falke.marco@gmail.com>2022-05-13 07:47:41 +0200
committerMacroFake <falke.marco@gmail.com>2022-05-13 07:47:45 +0200
commitb3f0a34389a490c50d28e80e712dc5f42a533ec3 (patch)
tree552de021fd58c4934573acc95ae9c3d0e50e968b
parentfe1fcdc629165f7b36530254f762444fc69966a3 (diff)
parent51ec96b904f349056e805c6b2a6de5257e8fbdee (diff)
Merge bitcoin/bitcoin#25119: net, refactor: move StartExtraBlockRelayPeers() from header to implementation
51ec96b904f349056e805c6b2a6de5257e8fbdee refactor: move StartExtraBlockRelayPeers from header to implementation (Jon Atack) Pull request description: 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. ACKs for top commit: LarryRuane: ACK 51ec96b904f349056e805c6b2a6de5257e8fbdee theStack: ACK 51ec96b904f349056e805c6b2a6de5257e8fbdee Tree-SHA512: 69b2c09163c48bfcb43355af0aa52ee7dd81efc755a7aa6a10f5e400b5e14109484437960a62a1cfac2524c2cfae981fee082846b19526b540ef5b86be97f0fe
-rw-r--r--src/net.cpp6
-rw-r--r--src/net.h6
2 files changed, 7 insertions, 5 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)
diff --git a/src/net.h b/src/net.h
index 5cdddf1fee..c0081f2e56 100644
--- a/src/net.h
+++ b/src/net.h
@@ -13,7 +13,6 @@
#include <crypto/siphash.h>
#include <hash.h>
#include <i2p.h>
-#include <logging.h>
#include <net_permissions.h>
#include <netaddress.h>
#include <netbase.h>
@@ -857,10 +856,7 @@ public:
void SetTryNewOutboundPeer(bool flag);
bool GetTryNewOutboundPeer() const;
- void StartExtraBlockRelayPeers() {
- LogPrint(BCLog::NET, "net: enabling extra block-relay-only peers\n");
- m_start_extra_block_relay_peers = true;
- }
+ void StartExtraBlockRelayPeers();
// Return the number of outbound peers we have in excess of our target (eg,
// if we previously called SetTryNewOutboundPeer(true), and have since set