Page MenuHomePhabricator

Fix enum NumConnections shadowing warning
AbandonedPublic

Authored by Fabien on Dec 10 2019, 10:37.

Details

Reviewers
deadalnix
Group Reviewers
Restricted Project
Summary

The enum NumConnections is double defined, once in the CConnman
class and once in the clientmodel.h file. Because clientmodel.cpp
includes clientmodel.h and net.h, there is a shadow warning.
This diff removes the definition from clientmodel.h and use the
CConnman definition instead, which simplifies the logic a bit.

Test Plan
ninja check

Build and run bitcoin-qt. Check the number of connections displayed in
the debug window is correct.

Diff Detail

Repository
rABC Bitcoin ABC
Branch
fix_duplicated_connections_enum
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 8473
Build 14957: Default Diff Build & Tests
Build 14956: arc lint + arc unit

Event Timeline

deadalnix requested changes to this revision.Dec 11 2019, 01:17
deadalnix added inline comments.
src/qt/clientmodel.h
8

It doesn't seem judicious to have client model depend on the network code.

37

The enum is still there.

This revision now requires changes to proceed.Dec 11 2019, 01:17
Fabien added inline comments.
src/qt/clientmodel.h
8

I was hesitant to do it, I'll use another approach.

37

Macro lolfail:  Doh !