File tree Expand file tree Collapse file tree 2 files changed +19
-7
lines changed Expand file tree Collapse file tree 2 files changed +19
-7
lines changed Original file line number Diff line number Diff line change @@ -2269,10 +2269,16 @@ bool CConnman::Start(CScheduler& scheduler, const Options& connOptions)
2269
2269
{
2270
2270
Init (connOptions);
2271
2271
2272
- nTotalBytesRecv = 0 ;
2273
- nTotalBytesSent = 0 ;
2274
- nMaxOutboundTotalBytesSentInCycle = 0 ;
2275
- nMaxOutboundCycleStartTime = 0 ;
2272
+ {
2273
+ LOCK (cs_totalBytesRecv);
2274
+ nTotalBytesRecv = 0 ;
2275
+ }
2276
+ {
2277
+ LOCK (cs_totalBytesSent);
2278
+ nTotalBytesSent = 0 ;
2279
+ nMaxOutboundTotalBytesSentInCycle = 0 ;
2280
+ nMaxOutboundCycleStartTime = 0 ;
2281
+ }
2276
2282
2277
2283
if (fListen && !InitBinds (connOptions.vBinds , connOptions.vWhiteBinds )) {
2278
2284
if (clientInterface) {
Original file line number Diff line number Diff line change @@ -158,10 +158,16 @@ class CConnman
158
158
m_msgproc = connOptions.m_msgproc ;
159
159
nSendBufferMaxSize = connOptions.nSendBufferMaxSize ;
160
160
nReceiveFloodSize = connOptions.nReceiveFloodSize ;
161
- nMaxOutboundTimeframe = connOptions.nMaxOutboundTimeframe ;
162
- nMaxOutboundLimit = connOptions.nMaxOutboundLimit ;
161
+ {
162
+ LOCK (cs_totalBytesSent);
163
+ nMaxOutboundTimeframe = connOptions.nMaxOutboundTimeframe ;
164
+ nMaxOutboundLimit = connOptions.nMaxOutboundLimit ;
165
+ }
163
166
vWhitelistedRange = connOptions.vWhitelistedRange ;
164
- vAddedNodes = connOptions.m_added_nodes ;
167
+ {
168
+ LOCK (cs_vAddedNodes);
169
+ vAddedNodes = connOptions.m_added_nodes ;
170
+ }
165
171
}
166
172
167
173
CConnman (uint64_t seed0, uint64_t seed1);
You can’t perform that action at this time.
0 commit comments