mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-05-21 17:31:05 +02:00
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.
This commit is contained in:
parent
207a228773
commit
b27ba169eb
@ -66,6 +66,8 @@ using interfaces::Node;
|
|||||||
using interfaces::WalletLoader;
|
using interfaces::WalletLoader;
|
||||||
|
|
||||||
namespace node {
|
namespace node {
|
||||||
|
// All members of the classes in this namespace are intentionally public, as the
|
||||||
|
// classes themselves are private.
|
||||||
namespace {
|
namespace {
|
||||||
#ifdef ENABLE_EXTERNAL_SIGNER
|
#ifdef ENABLE_EXTERNAL_SIGNER
|
||||||
class ExternalSignerImpl : public interfaces::ExternalSigner
|
class ExternalSignerImpl : public interfaces::ExternalSigner
|
||||||
@ -73,15 +75,12 @@ class ExternalSignerImpl : public interfaces::ExternalSigner
|
|||||||
public:
|
public:
|
||||||
ExternalSignerImpl(::ExternalSigner signer) : m_signer(std::move(signer)) {}
|
ExternalSignerImpl(::ExternalSigner signer) : m_signer(std::move(signer)) {}
|
||||||
std::string getName() override { return m_signer.m_name; }
|
std::string getName() override { return m_signer.m_name; }
|
||||||
private:
|
|
||||||
::ExternalSigner m_signer;
|
::ExternalSigner m_signer;
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
class NodeImpl : public Node
|
class NodeImpl : public Node
|
||||||
{
|
{
|
||||||
private:
|
|
||||||
ChainstateManager& chainman() { return *Assert(m_context->chainman); }
|
|
||||||
public:
|
public:
|
||||||
explicit NodeImpl(NodeContext& context) { setContext(&context); }
|
explicit NodeImpl(NodeContext& context) { setContext(&context); }
|
||||||
void initLogging() override { InitLogging(*Assert(m_context->args)); }
|
void initLogging() override { InitLogging(*Assert(m_context->args)); }
|
||||||
@ -389,6 +388,7 @@ public:
|
|||||||
{
|
{
|
||||||
m_context = context;
|
m_context = context;
|
||||||
}
|
}
|
||||||
|
ChainstateManager& chainman() { return *Assert(m_context->chainman); }
|
||||||
NodeContext* m_context{nullptr};
|
NodeContext* m_context{nullptr};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -501,8 +501,6 @@ public:
|
|||||||
|
|
||||||
class ChainImpl : public Chain
|
class ChainImpl : public Chain
|
||||||
{
|
{
|
||||||
private:
|
|
||||||
ChainstateManager& chainman() { return *Assert(m_node.chainman); }
|
|
||||||
public:
|
public:
|
||||||
explicit ChainImpl(NodeContext& node) : m_node(node) {}
|
explicit ChainImpl(NodeContext& node) : m_node(node) {}
|
||||||
std::optional<int> getHeight() override
|
std::optional<int> getHeight() override
|
||||||
@ -782,6 +780,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
NodeContext* context() override { return &m_node; }
|
NodeContext* context() override { return &m_node; }
|
||||||
|
ChainstateManager& chainman() { return *Assert(m_node.chainman); }
|
||||||
NodeContext& m_node;
|
NodeContext& m_node;
|
||||||
};
|
};
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@ -48,6 +48,8 @@ using interfaces::WalletTxStatus;
|
|||||||
using interfaces::WalletValueMap;
|
using interfaces::WalletValueMap;
|
||||||
|
|
||||||
namespace wallet {
|
namespace wallet {
|
||||||
|
// All members of the classes in this namespace are intentionally public, as the
|
||||||
|
// classes themselves are private.
|
||||||
namespace {
|
namespace {
|
||||||
//! Construct wallet tx struct.
|
//! Construct wallet tx struct.
|
||||||
WalletTx MakeWalletTx(CWallet& wallet, const CWalletTx& wtx)
|
WalletTx MakeWalletTx(CWallet& wallet, const CWalletTx& wtx)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user