HomePhabricator

refactor: Add and use EnsureConnman in rpc code

Description

refactor: Add and use EnsureConnman in rpc code

Summary:
This concludes backport of core#21719
https://github.com/bitcoin/bitcoin/pull/21719/commits/fafb68add5e16e8bd5b9428bcffcaee2639747cf

Depends on D12699

Note: in D7990, in getnodeaddresses and setnetworkactive, the if (!node.connman) test were replaced by if (!node.banman). As far as I can tell, this is a mistake, so I reverted to the if (!node.connman) solution to stay closer to the source material and remove 2 more blocks of boilerplate code. I don't think this matters anyway, as both the connman and the banman are always unconditionally created in AppInitMain, so I don't see how either one of them can be unavailable in the context of a RPC call.

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

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

Details

Provenance
MarcoFalke <falke.marco@gmail.com>Authored on Apr 17 2021, 18:59
PiRKCommitted on Nov 30 2022, 16:25
PiRKPushed on Nov 30 2022, 16:25
Reviewer
Restricted Project
Differential Revision
D12700: refactor: Add and use EnsureConnman in rpc code
Parents
rABC135be957a372: refactor: Mark member functions const
Branches
Unknown
Tags
Unknown