mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-10 20:03:34 -03:00
[net processing] Move nPreferredDownload into PeerManagerImpl
This commit is contained in:
parent
a292df283a
commit
490c08f96a
1 changed files with 6 additions and 9 deletions
|
@ -610,6 +610,11 @@ private:
|
|||
/** Number of outbound peers with m_chain_sync.m_protect. */
|
||||
int m_outbound_peers_with_protect_from_disconnect GUARDED_BY(cs_main) = 0;
|
||||
|
||||
/** Number of preferable block download peers. */
|
||||
int nPreferredDownload GUARDED_BY(cs_main){0};
|
||||
|
||||
void UpdatePreferredDownload(const CNode& node, CNodeState* state) EXCLUSIVE_LOCKS_REQUIRED(cs_main);
|
||||
|
||||
bool AlreadyHaveTx(const GenTxid& gtxid) EXCLUSIVE_LOCKS_REQUIRED(cs_main);
|
||||
|
||||
/**
|
||||
|
@ -817,14 +822,6 @@ private:
|
|||
*/
|
||||
bool SetupAddressRelay(const CNode& node, Peer& peer);
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace {
|
||||
/** Number of preferable block download peers. */
|
||||
int nPreferredDownload GUARDED_BY(cs_main) = 0;
|
||||
} // namespace
|
||||
|
||||
namespace {
|
||||
|
||||
const CNodeState* PeerManagerImpl::State(NodeId pnode) const EXCLUSIVE_LOCKS_REQUIRED(cs_main)
|
||||
{
|
||||
|
@ -878,7 +875,7 @@ static void AddKnownTx(Peer& peer, const uint256& hash)
|
|||
}
|
||||
}
|
||||
|
||||
static void UpdatePreferredDownload(const CNode& node, CNodeState* state) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
|
||||
void PeerManagerImpl::UpdatePreferredDownload(const CNode& node, CNodeState* state) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
|
||||
{
|
||||
nPreferredDownload -= state->fPreferredDownload;
|
||||
|
||||
|
|
Loading…
Reference in a new issue