Skip to content

Commit a237a06

Browse files
committed
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-
1 parent 5fdf37e commit a237a06

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

src/net.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2913,7 +2913,7 @@ void CConnman::RecordBytesRecv(uint64_t bytes)
29132913

29142914
void CConnman::RecordBytesSent(uint64_t bytes)
29152915
{
2916-
LOCK(cs_totalBytesSent);
2916+
LOCK(m_total_bytes_sent_mutex);
29172917
nTotalBytesSent += bytes;
29182918

29192919
const auto now = GetTime<std::chrono::seconds>();
@@ -2929,7 +2929,7 @@ void CConnman::RecordBytesSent(uint64_t bytes)
29292929

29302930
uint64_t CConnman::GetMaxOutboundTarget() const
29312931
{
2932-
LOCK(cs_totalBytesSent);
2932+
LOCK(m_total_bytes_sent_mutex);
29332933
return nMaxOutboundLimit;
29342934
}
29352935

@@ -2940,7 +2940,7 @@ std::chrono::seconds CConnman::GetMaxOutboundTimeframe() const
29402940

29412941
std::chrono::seconds CConnman::GetMaxOutboundTimeLeftInCycle() const
29422942
{
2943-
LOCK(cs_totalBytesSent);
2943+
LOCK(m_total_bytes_sent_mutex);
29442944
if (nMaxOutboundLimit == 0)
29452945
return 0s;
29462946

@@ -2954,7 +2954,7 @@ std::chrono::seconds CConnman::GetMaxOutboundTimeLeftInCycle() const
29542954

29552955
bool CConnman::OutboundTargetReached(bool historicalBlockServingLimit) const
29562956
{
2957-
LOCK(cs_totalBytesSent);
2957+
LOCK(m_total_bytes_sent_mutex);
29582958
if (nMaxOutboundLimit == 0)
29592959
return false;
29602960

@@ -2974,7 +2974,7 @@ bool CConnman::OutboundTargetReached(bool historicalBlockServingLimit) const
29742974

29752975
uint64_t CConnman::GetOutboundTargetBytesLeft() const
29762976
{
2977-
LOCK(cs_totalBytesSent);
2977+
LOCK(m_total_bytes_sent_mutex);
29782978
if (nMaxOutboundLimit == 0)
29792979
return 0;
29802980

@@ -2988,7 +2988,7 @@ uint64_t CConnman::GetTotalBytesRecv() const
29882988

29892989
uint64_t CConnman::GetTotalBytesSent() const
29902990
{
2991-
LOCK(cs_totalBytesSent);
2991+
LOCK(m_total_bytes_sent_mutex);
29922992
return nTotalBytesSent;
29932993
}
29942994

src/net.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,7 @@ class CConnman
776776
nReceiveFloodSize = connOptions.nReceiveFloodSize;
777777
m_peer_connect_timeout = std::chrono::seconds{connOptions.m_peer_connect_timeout};
778778
{
779-
LOCK(cs_totalBytesSent);
779+
LOCK(m_total_bytes_sent_mutex);
780780
nMaxOutboundLimit = connOptions.nMaxOutboundLimit;
781781
}
782782
vWhitelistedRange = connOptions.vWhitelistedRange;
@@ -1062,14 +1062,14 @@ class CConnman
10621062
static bool NodeFullyConnected(const CNode* pnode);
10631063

10641064
// Network usage totals
1065-
mutable RecursiveMutex cs_totalBytesSent;
1065+
mutable RecursiveMutex m_total_bytes_sent_mutex;
10661066
std::atomic<uint64_t> nTotalBytesRecv{0};
1067-
uint64_t nTotalBytesSent GUARDED_BY(cs_totalBytesSent) {0};
1067+
uint64_t nTotalBytesSent GUARDED_BY(m_total_bytes_sent_mutex) {0};
10681068

10691069
// outbound limit & stats
1070-
uint64_t nMaxOutboundTotalBytesSentInCycle GUARDED_BY(cs_totalBytesSent) {0};
1071-
std::chrono::seconds nMaxOutboundCycleStartTime GUARDED_BY(cs_totalBytesSent) {0};
1072-
uint64_t nMaxOutboundLimit GUARDED_BY(cs_totalBytesSent);
1070+
uint64_t nMaxOutboundTotalBytesSentInCycle GUARDED_BY(m_total_bytes_sent_mutex) {0};
1071+
std::chrono::seconds nMaxOutboundCycleStartTime GUARDED_BY(m_total_bytes_sent_mutex) {0};
1072+
uint64_t nMaxOutboundLimit GUARDED_BY(m_total_bytes_sent_mutex);
10731073

10741074
// P2P timeout in seconds
10751075
std::chrono::seconds m_peer_connect_timeout;

0 commit comments

Comments
 (0)