Page MenuHomePhabricator

refactor: replace CConnman pointers by references in net_processing.cpp

Authored by Fabien on Fri, Nov 20, 16:06.


This is a follow-up to the recently merged PR #19053, replacing two more
types of one more type of pointer (CConnman) by references to increase
the code quality -- pointers should either check for nullptr or be
replaced by references, and the latter strategy seems to be more

Again, to keep the review burden managable, the changes are kept simple,

    only tackling CConnman* and BanMan* pointers
    only within the net_processing module, i.e. no changes that would
need adaption in other modules
    keeping the names of the variables as they are

Backport of core PR19174.

Depends on D8479.

Test Plan
ninja all check-all

Diff Detail

rABC Bitcoin ABC
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Fabien requested review of this revision.Fri, Nov 20, 16:06

Failed tests logs:

====== Bitcoin ABC functional tests: ======

------- Stdout: -------
2020-11-20T16:11:46.603000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-without-wallet/test/tmp/test_runner_₿₵_  _20201120_161114/p2p_timeouts_112
2020-11-20T16:11:51.915000Z TestFramework (ERROR): Assertion failed
Traceback (most recent call last):
  File "/work/test/functional/test_framework/", line 120, in main
  File "/work/test/functional/", line 89, in run_test
    assert not no_verack_node.is_connected
2020-11-20T16:11:54.592000Z TestFramework (INFO): Stopping nodes
2020-11-20T16:11:55.648000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/build-without-wallet/test/tmp/test_runner_₿₵_  _20201120_161114/p2p_timeouts_112
2020-11-20T16:11:55.648000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/build-without-wallet/test/tmp/test_runner_₿₵_  _20201120_161114/p2p_timeouts_112/test_framework.log
2020-11-20T16:11:55.648000Z TestFramework (ERROR): Hint: Call /work/test/functional/ '/work/abc-ci-builds/build-without-wallet/test/tmp/test_runner_₿₵_  _20201120_161114/p2p_timeouts_112' to consolidate all logs

Each failure log is accessible here:
Bitcoin ABC functional tests:

This revision is now accepted and ready to land.Sat, Nov 21, 00:37