Skip to content

Commit 490c08f

Browse files
committed
[net processing] Move nPreferredDownload into PeerManagerImpl
1 parent a292df2 commit 490c08f

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

src/net_processing.cpp

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -610,6 +610,11 @@ class PeerManagerImpl final : public PeerManager
610610
/** Number of outbound peers with m_chain_sync.m_protect. */
611611
int m_outbound_peers_with_protect_from_disconnect GUARDED_BY(cs_main) = 0;
612612

613+
/** Number of preferable block download peers. */
614+
int nPreferredDownload GUARDED_BY(cs_main){0};
615+
616+
void UpdatePreferredDownload(const CNode& node, CNodeState* state) EXCLUSIVE_LOCKS_REQUIRED(cs_main);
617+
613618
bool AlreadyHaveTx(const GenTxid& gtxid) EXCLUSIVE_LOCKS_REQUIRED(cs_main);
614619

615620
/**
@@ -817,14 +822,6 @@ class PeerManagerImpl final : public PeerManager
817822
*/
818823
bool SetupAddressRelay(const CNode& node, Peer& peer);
819824
};
820-
} // namespace
821-
822-
namespace {
823-
/** Number of preferable block download peers. */
824-
int nPreferredDownload GUARDED_BY(cs_main) = 0;
825-
} // namespace
826-
827-
namespace {
828825

829826
const CNodeState* PeerManagerImpl::State(NodeId pnode) const EXCLUSIVE_LOCKS_REQUIRED(cs_main)
830827
{
@@ -878,7 +875,7 @@ static void AddKnownTx(Peer& peer, const uint256& hash)
878875
}
879876
}
880877

881-
static void UpdatePreferredDownload(const CNode& node, CNodeState* state) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
878+
void PeerManagerImpl::UpdatePreferredDownload(const CNode& node, CNodeState* state) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
882879
{
883880
nPreferredDownload -= state->fPreferredDownload;
884881

0 commit comments

Comments
 (0)