HomePhabricator

gui: Set CConnman byte counters earlier to avoid uninitialized reads

Description

gui: Set CConnman byte counters earlier to avoid uninitialized reads

Summary:
Initialize CConnman byte counters during construction, so GetTotalBytesRecv()
and GetTotalBytesSent() methods don't return garbage before Start() is called.

Change shouldn't have any effect outside of the GUI. It just fixes a race
condition during a qt test that was observed on travis

This is a backport of Core PR17906

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

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

Details

Provenance
Russell Yanofsky <russ@yanofsky.org>Authored on Jan 10 2020, 19:55
PiRKCommitted on Nov 17 2020, 09:35
PiRKPushed on Nov 17 2020, 09:35
Reviewer
Restricted Project
Differential Revision
D8429: gui: Set CConnman byte counters earlier to avoid uninitialized reads
Parents
rABCf97ac6173722: docs: Fix conflicting statements about initialization in developer notes
Branches
Unknown
Tags
Unknown