Merge pull request #2759 from patricklodder/1.14.6-initialize-counters

net: avoid uninitialized reads on counters
This commit is contained in:
Ross Nicoll 2021-12-19 11:36:28 +00:00 committed by GitHub
commit e4e3371b6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 4 deletions

View File

@ -2217,8 +2217,6 @@ NodeId CConnman::GetNewNodeId()
bool CConnman::Start(CScheduler& scheduler, std::string& strNodeError, Options connOptions)
{
nTotalBytesRecv = 0;
nTotalBytesSent = 0;
nMaxOutboundTotalBytesSentInCycle = 0;
nMaxOutboundCycleStartTime = 0;

View File

@ -339,8 +339,8 @@ private:
// Network usage totals
CCriticalSection cs_totalBytesRecv;
CCriticalSection cs_totalBytesSent;
uint64_t nTotalBytesRecv;
uint64_t nTotalBytesSent;
uint64_t nTotalBytesRecv = 0;
uint64_t nTotalBytesSent = 0;
// outbound limit & stats
uint64_t nMaxOutboundTotalBytesSentInCycle;