diff options
author | Jon Atack <jon@atack.com> | 2022-07-20 17:17:34 +0200 |
---|---|---|
committer | Jon Atack <jon@atack.com> | 2022-07-29 19:27:16 +0200 |
commit | b27ba169ebd4a8e4ec29be590f03a4d0da61a0cc (patch) | |
tree | cc207bba001c7aafde455f48484f3a25d589c0aa /src/node | |
parent | 207a22877330709e4462e6092c265ab55c8653ac (diff) | |
download | bitcoin-b27ba169ebd4a8e4ec29be590f03a4d0da61a0cc.tar.xz |
refactor: make all NodeImpl/ChainImpl/ExternalSignerImpl members public
as the classes themselves are private, and to be consistent within all the
*Impl classes in src/node/interfaces.cpp and src/wallet/interfaces.cpp
following this order:
public:
// ... virtual methods ...
// ... nonvirtual helper methods ...
// ... data members ...
and add documentation in src/node/interfaces.cpp and src/wallet/interfaces.cpp
to help future reviewers and contributors.
Diffstat (limited to 'src/node')
-rw-r--r-- | src/node/interfaces.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/node/interfaces.cpp b/src/node/interfaces.cpp index 46d45377fa..b5a6374fcb 100644 --- a/src/node/interfaces.cpp +++ b/src/node/interfaces.cpp @@ -66,6 +66,8 @@ using interfaces::Node; using interfaces::WalletLoader; namespace node { +// All members of the classes in this namespace are intentionally public, as the +// classes themselves are private. namespace { #ifdef ENABLE_EXTERNAL_SIGNER class ExternalSignerImpl : public interfaces::ExternalSigner @@ -73,15 +75,12 @@ class ExternalSignerImpl : public interfaces::ExternalSigner public: ExternalSignerImpl(::ExternalSigner signer) : m_signer(std::move(signer)) {} std::string getName() override { return m_signer.m_name; } -private: ::ExternalSigner m_signer; }; #endif class NodeImpl : public Node { -private: - ChainstateManager& chainman() { return *Assert(m_context->chainman); } public: explicit NodeImpl(NodeContext& context) { setContext(&context); } void initLogging() override { InitLogging(*Assert(m_context->args)); } @@ -389,6 +388,7 @@ public: { m_context = context; } + ChainstateManager& chainman() { return *Assert(m_context->chainman); } NodeContext* m_context{nullptr}; }; @@ -501,8 +501,6 @@ public: class ChainImpl : public Chain { -private: - ChainstateManager& chainman() { return *Assert(m_node.chainman); } public: explicit ChainImpl(NodeContext& node) : m_node(node) {} std::optional<int> getHeight() override @@ -782,6 +780,7 @@ public: } NodeContext* context() override { return &m_node; } + ChainstateManager& chainman() { return *Assert(m_node.chainman); } NodeContext& m_node; }; } // namespace |