HomePhabricator

CConnman: initialise at declaration rather than in Start()

Description

CConnman: initialise at declaration rather than in Start()

Summary:
Ensure nMaxOutboundTotalBytesSentInCycle and nMaxOutboundCycleStartTime are initialized even if CConnman::Start() is not called. Prevents failures in test/fuzz/connman when run under valgrind.

nTotalBytesRecv and nTotalBytesSent are already initialized in the class definition, and CConnman::Start is only called once in AppInitMain, so removing the reinitialization in Start has no impact.

This is a backport of core#20408

Test Plan:
With TSAN:
ninja && ninja check check-functional

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D10740

Details

Provenance
Anthony Towns <aj@erisian.com.au>Authored on Nov 17 2020, 12:56
PiRKCommitted on Jan 3 2022, 14:08
PiRKPushed on Jan 3 2022, 14:08
Reviewer
Restricted Project
Differential Revision
D10740: CConnman: initialise at declaration rather than in Start()
Parents
rABC9f54c180f59c: remove CRPCCommand constructor that takes rpcfn_type function pointer
Branches
Unknown
Tags
Unknown