mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 03:52:49 +01:00
Merge #20408: CConnman: move initialization to declaration
9d09132be4ff99f98ca905c342347d5f35f13350 CConnman: initialise at declaration rather than in Start() (Anthony Towns)
Pull request description:
Ensure nMaxOutboundTotalBytesSentInCycle and nMaxOutboundCycleStartTime are initialized even if CConnman::Start() is not called. Prevents failures in test/fuzz/connman when run under valgrind.
ACKs for top commit:
practicalswift:
ACK 9d09132be4ff99f98ca905c342347d5f35f13350: patch looks correct!
MarcoFalke:
review ACK 9d09132be4ff99f98ca905c342347d5f35f13350 , checked that we call Start only once and in the same scope where connman is constructed (AppInitMain) 💸
jnewbery:
Code review ACK 9d09132be4
Tree-SHA512: 1c6c893e8c616a91947a8cc295b0ba508af3ecfcdcd94cdc5f95d808cc93c6d1a71fd24dcc194dc583854e9889fb522ca8523043367fb0263370fbcab08c6aaa
This commit is contained in:
parent
92e5f9f35d
commit
1bd4d8de71
11
src/net.cpp
11
src/net.cpp
@ -3080,17 +3080,6 @@ bool CConnman::Start(CScheduler& scheduler, const Options& connOptions)
|
||||
{
|
||||
Init(connOptions);
|
||||
|
||||
{
|
||||
LOCK(cs_totalBytesRecv);
|
||||
nTotalBytesRecv = 0;
|
||||
}
|
||||
{
|
||||
LOCK(cs_totalBytesSent);
|
||||
nTotalBytesSent = 0;
|
||||
nMaxOutboundTotalBytesSentInCycle = 0;
|
||||
nMaxOutboundCycleStartTime = 0s;
|
||||
}
|
||||
|
||||
#ifdef USE_KQUEUE
|
||||
if (socketEventsMode == SOCKETEVENTS_KQUEUE) {
|
||||
kqueuefd = kqueue();
|
||||
|
@ -591,8 +591,8 @@ private:
|
||||
uint64_t nTotalBytesSent GUARDED_BY(cs_totalBytesSent) {0};
|
||||
|
||||
// outbound limit & stats
|
||||
uint64_t nMaxOutboundTotalBytesSentInCycle GUARDED_BY(cs_totalBytesSent);
|
||||
std::chrono::seconds nMaxOutboundCycleStartTime GUARDED_BY(cs_totalBytesSent);
|
||||
uint64_t nMaxOutboundTotalBytesSentInCycle GUARDED_BY(cs_totalBytesSent) {0};
|
||||
std::chrono::seconds nMaxOutboundCycleStartTime GUARDED_BY(cs_totalBytesSent) {0};
|
||||
uint64_t nMaxOutboundLimit GUARDED_BY(cs_totalBytesSent);
|
||||
|
||||
// P2P timeout in seconds
|
||||
|
Loading…
Reference in New Issue
Block a user