aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJon Atack <jon@atack.com>2022-07-20 17:17:34 +0200
committerJon Atack <jon@atack.com>2022-07-29 19:27:16 +0200
commitb27ba169ebd4a8e4ec29be590f03a4d0da61a0cc (patch)
treecc207bba001c7aafde455f48484f3a25d589c0aa /src
parent207a22877330709e4462e6092c265ab55c8653ac (diff)
downloadbitcoin-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')
-rw-r--r--src/node/interfaces.cpp9
-rw-r--r--src/wallet/interfaces.cpp2
2 files changed, 6 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
diff --git a/src/wallet/interfaces.cpp b/src/wallet/interfaces.cpp
index 23f91d9b3a..4f30060e29 100644
--- a/src/wallet/interfaces.cpp
+++ b/src/wallet/interfaces.cpp
@@ -48,6 +48,8 @@ using interfaces::WalletTxStatus;
using interfaces::WalletValueMap;
namespace wallet {
+// All members of the classes in this namespace are intentionally public, as the
+// classes themselves are private.
namespace {
//! Construct wallet tx struct.
WalletTx MakeWalletTx(CWallet& wallet, const CWalletTx& wtx)