Page MenuHomePhabricator

refactor: replace CConnman pointers by references in net_processing.cpp
ClosedPublic

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

Details

Summary
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
reasonable.

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

Repository
rABC Bitcoin ABC
Lint
Automatic diff as part of commit; lint not applicable.
Unit
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: p2p_timeouts.py ======

------- 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/test_framework.py", line 120, in main
    self.run_test()
  File "/work/test/functional/p2p_timeouts.py", line 89, in run_test
    assert not no_verack_node.is_connected
AssertionError
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/combine_logs.py '/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: p2p_timeouts.py

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