mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-03-08 14:34:53 -05:00
scripted-diff: rename cs_totalBytesSent -> m_total_bytes_sent_mutex
-BEGIN VERIFY SCRIPT- sed -i 's/cs_totalBytesSent/m_total_bytes_sent_mutex/g' -- $(git grep --files-with-matches 'cs_totalBytesSent') -END VERIFY SCRIPT-
This commit is contained in:
parent
5fdf37e14b
commit
a237a065cc
2 changed files with 12 additions and 12 deletions
12
src/net.cpp
12
src/net.cpp
|
@ -2913,7 +2913,7 @@ void CConnman::RecordBytesRecv(uint64_t bytes)
|
||||||
|
|
||||||
void CConnman::RecordBytesSent(uint64_t bytes)
|
void CConnman::RecordBytesSent(uint64_t bytes)
|
||||||
{
|
{
|
||||||
LOCK(cs_totalBytesSent);
|
LOCK(m_total_bytes_sent_mutex);
|
||||||
nTotalBytesSent += bytes;
|
nTotalBytesSent += bytes;
|
||||||
|
|
||||||
const auto now = GetTime<std::chrono::seconds>();
|
const auto now = GetTime<std::chrono::seconds>();
|
||||||
|
@ -2929,7 +2929,7 @@ void CConnman::RecordBytesSent(uint64_t bytes)
|
||||||
|
|
||||||
uint64_t CConnman::GetMaxOutboundTarget() const
|
uint64_t CConnman::GetMaxOutboundTarget() const
|
||||||
{
|
{
|
||||||
LOCK(cs_totalBytesSent);
|
LOCK(m_total_bytes_sent_mutex);
|
||||||
return nMaxOutboundLimit;
|
return nMaxOutboundLimit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2940,7 +2940,7 @@ std::chrono::seconds CConnman::GetMaxOutboundTimeframe() const
|
||||||
|
|
||||||
std::chrono::seconds CConnman::GetMaxOutboundTimeLeftInCycle() const
|
std::chrono::seconds CConnman::GetMaxOutboundTimeLeftInCycle() const
|
||||||
{
|
{
|
||||||
LOCK(cs_totalBytesSent);
|
LOCK(m_total_bytes_sent_mutex);
|
||||||
if (nMaxOutboundLimit == 0)
|
if (nMaxOutboundLimit == 0)
|
||||||
return 0s;
|
return 0s;
|
||||||
|
|
||||||
|
@ -2954,7 +2954,7 @@ std::chrono::seconds CConnman::GetMaxOutboundTimeLeftInCycle() const
|
||||||
|
|
||||||
bool CConnman::OutboundTargetReached(bool historicalBlockServingLimit) const
|
bool CConnman::OutboundTargetReached(bool historicalBlockServingLimit) const
|
||||||
{
|
{
|
||||||
LOCK(cs_totalBytesSent);
|
LOCK(m_total_bytes_sent_mutex);
|
||||||
if (nMaxOutboundLimit == 0)
|
if (nMaxOutboundLimit == 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -2974,7 +2974,7 @@ bool CConnman::OutboundTargetReached(bool historicalBlockServingLimit) const
|
||||||
|
|
||||||
uint64_t CConnman::GetOutboundTargetBytesLeft() const
|
uint64_t CConnman::GetOutboundTargetBytesLeft() const
|
||||||
{
|
{
|
||||||
LOCK(cs_totalBytesSent);
|
LOCK(m_total_bytes_sent_mutex);
|
||||||
if (nMaxOutboundLimit == 0)
|
if (nMaxOutboundLimit == 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
@ -2988,7 +2988,7 @@ uint64_t CConnman::GetTotalBytesRecv() const
|
||||||
|
|
||||||
uint64_t CConnman::GetTotalBytesSent() const
|
uint64_t CConnman::GetTotalBytesSent() const
|
||||||
{
|
{
|
||||||
LOCK(cs_totalBytesSent);
|
LOCK(m_total_bytes_sent_mutex);
|
||||||
return nTotalBytesSent;
|
return nTotalBytesSent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
12
src/net.h
12
src/net.h
|
@ -776,7 +776,7 @@ public:
|
||||||
nReceiveFloodSize = connOptions.nReceiveFloodSize;
|
nReceiveFloodSize = connOptions.nReceiveFloodSize;
|
||||||
m_peer_connect_timeout = std::chrono::seconds{connOptions.m_peer_connect_timeout};
|
m_peer_connect_timeout = std::chrono::seconds{connOptions.m_peer_connect_timeout};
|
||||||
{
|
{
|
||||||
LOCK(cs_totalBytesSent);
|
LOCK(m_total_bytes_sent_mutex);
|
||||||
nMaxOutboundLimit = connOptions.nMaxOutboundLimit;
|
nMaxOutboundLimit = connOptions.nMaxOutboundLimit;
|
||||||
}
|
}
|
||||||
vWhitelistedRange = connOptions.vWhitelistedRange;
|
vWhitelistedRange = connOptions.vWhitelistedRange;
|
||||||
|
@ -1062,14 +1062,14 @@ private:
|
||||||
static bool NodeFullyConnected(const CNode* pnode);
|
static bool NodeFullyConnected(const CNode* pnode);
|
||||||
|
|
||||||
// Network usage totals
|
// Network usage totals
|
||||||
mutable RecursiveMutex cs_totalBytesSent;
|
mutable RecursiveMutex m_total_bytes_sent_mutex;
|
||||||
std::atomic<uint64_t> nTotalBytesRecv{0};
|
std::atomic<uint64_t> nTotalBytesRecv{0};
|
||||||
uint64_t nTotalBytesSent GUARDED_BY(cs_totalBytesSent) {0};
|
uint64_t nTotalBytesSent GUARDED_BY(m_total_bytes_sent_mutex) {0};
|
||||||
|
|
||||||
// outbound limit & stats
|
// outbound limit & stats
|
||||||
uint64_t nMaxOutboundTotalBytesSentInCycle GUARDED_BY(cs_totalBytesSent) {0};
|
uint64_t nMaxOutboundTotalBytesSentInCycle GUARDED_BY(m_total_bytes_sent_mutex) {0};
|
||||||
std::chrono::seconds nMaxOutboundCycleStartTime GUARDED_BY(cs_totalBytesSent) {0};
|
std::chrono::seconds nMaxOutboundCycleStartTime GUARDED_BY(m_total_bytes_sent_mutex) {0};
|
||||||
uint64_t nMaxOutboundLimit GUARDED_BY(cs_totalBytesSent);
|
uint64_t nMaxOutboundLimit GUARDED_BY(m_total_bytes_sent_mutex);
|
||||||
|
|
||||||
// P2P timeout in seconds
|
// P2P timeout in seconds
|
||||||
std::chrono::seconds m_peer_connect_timeout;
|
std::chrono::seconds m_peer_connect_timeout;
|
||||||
|
|
Loading…
Add table
Reference in a new issue