mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-05-25 03:12:38 +02:00
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.
This commit is contained in:
parent
dd9f61a184
commit
51ec96b904
@ -1867,6 +1867,12 @@ void CConnman::SetTryNewOutboundPeer(bool flag)
|
|||||||
LogPrint(BCLog::NET, "net: setting try another outbound peer=%s\n", flag ? "true" : "false");
|
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
|
// Return the number of peers we have over our outbound connection limit
|
||||||
// Exclude peers that are marked for disconnect, or are going to be
|
// Exclude peers that are marked for disconnect, or are going to be
|
||||||
// disconnected soon (eg ADDR_FETCH and FEELER)
|
// disconnected soon (eg ADDR_FETCH and FEELER)
|
||||||
|
@ -13,7 +13,6 @@
|
|||||||
#include <crypto/siphash.h>
|
#include <crypto/siphash.h>
|
||||||
#include <hash.h>
|
#include <hash.h>
|
||||||
#include <i2p.h>
|
#include <i2p.h>
|
||||||
#include <logging.h>
|
|
||||||
#include <net_permissions.h>
|
#include <net_permissions.h>
|
||||||
#include <netaddress.h>
|
#include <netaddress.h>
|
||||||
#include <netbase.h>
|
#include <netbase.h>
|
||||||
@ -857,10 +856,7 @@ public:
|
|||||||
void SetTryNewOutboundPeer(bool flag);
|
void SetTryNewOutboundPeer(bool flag);
|
||||||
bool GetTryNewOutboundPeer() const;
|
bool GetTryNewOutboundPeer() const;
|
||||||
|
|
||||||
void StartExtraBlockRelayPeers() {
|
void StartExtraBlockRelayPeers();
|
||||||
LogPrint(BCLog::NET, "net: enabling extra block-relay-only peers\n");
|
|
||||||
m_start_extra_block_relay_peers = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Return the number of outbound peers we have in excess of our target (eg,
|
// Return the number of outbound peers we have in excess of our target (eg,
|
||||||
// if we previously called SetTryNewOutboundPeer(true), and have since set
|
// if we previously called SetTryNewOutboundPeer(true), and have since set
|
||||||
|
Loading…
x
Reference in New Issue
Block a user