Changeset View
Changeset View
Standalone View
Standalone View
src/interfaces/node.cpp
Show All 17 Lines | |||||
#include <netaddress.h> | #include <netaddress.h> | ||||
#include <netbase.h> | #include <netbase.h> | ||||
#include <node/context.h> | #include <node/context.h> | ||||
#include <policy/fees.h> | #include <policy/fees.h> | ||||
#include <policy/settings.h> | #include <policy/settings.h> | ||||
#include <primitives/block.h> | #include <primitives/block.h> | ||||
#include <rpc/server.h> | #include <rpc/server.h> | ||||
#include <shutdown.h> | #include <shutdown.h> | ||||
#include <support/allocators/secure.h> | |||||
#include <sync.h> | #include <sync.h> | ||||
#include <txmempool.h> | #include <txmempool.h> | ||||
#include <ui_interface.h> | #include <ui_interface.h> | ||||
#include <util/system.h> | #include <util/system.h> | ||||
#include <validation.h> | #include <validation.h> | ||||
#include <warnings.h> | #include <warnings.h> | ||||
#if defined(HAVE_CONFIG_H) | #if defined(HAVE_CONFIG_H) | ||||
#include <config/bitcoin-config.h> | #include <config/bitcoin-config.h> | ||||
#endif | #endif | ||||
#include <univalue.h> | #include <univalue.h> | ||||
class HTTPRPCRequestProcessor; | class HTTPRPCRequestProcessor; | ||||
class CWallet; | class CWallet; | ||||
fs::path GetWalletDir(); | fs::path GetWalletDir(); | ||||
std::vector<fs::path> ListWalletDir(); | std::vector<fs::path> ListWalletDir(); | ||||
std::vector<std::shared_ptr<CWallet>> GetWallets(); | std::vector<std::shared_ptr<CWallet>> GetWallets(); | ||||
std::shared_ptr<CWallet> LoadWallet(const CChainParams &chainParams, | std::shared_ptr<CWallet> LoadWallet(const CChainParams &chainParams, | ||||
interfaces::Chain &chain, | interfaces::Chain &chain, | ||||
const std::string &name, std::string &error, | const std::string &name, std::string &error, | ||||
std::string &warning); | std::string &warning); | ||||
WalletCreationStatus | |||||
CreateWallet(const CChainParams ¶ms, interfaces::Chain &chain, | |||||
const SecureString &passphrase, uint64_t wallet_creation_flags, | |||||
const std::string &name, std::string &error, std::string &warning, | |||||
std::shared_ptr<CWallet> &result); | |||||
namespace interfaces { | namespace interfaces { | ||||
class Wallet; | class Wallet; | ||||
namespace { | namespace { | ||||
class NodeImpl : public Node { | class NodeImpl : public Node { | ||||
▲ Show 20 Lines • Show All 217 Lines • ▼ Show 20 Lines | public: | ||||
return wallets; | return wallets; | ||||
} | } | ||||
std::unique_ptr<Wallet> | std::unique_ptr<Wallet> | ||||
loadWallet(const CChainParams ¶ms, const std::string &name, | loadWallet(const CChainParams ¶ms, const std::string &name, | ||||
std::string &error, std::string &warning) const override { | std::string &error, std::string &warning) const override { | ||||
return MakeWallet( | return MakeWallet( | ||||
LoadWallet(params, *m_context.chain, name, error, warning)); | LoadWallet(params, *m_context.chain, name, error, warning)); | ||||
} | } | ||||
WalletCreationStatus | |||||
createWallet(const CChainParams ¶ms, const SecureString &passphrase, | |||||
uint64_t wallet_creation_flags, const std::string &name, | |||||
std::string &error, std::string &warning, | |||||
std::unique_ptr<Wallet> &result) override { | |||||
std::shared_ptr<CWallet> wallet; | |||||
WalletCreationStatus status = CreateWallet( | |||||
params, *m_context.chain, passphrase, wallet_creation_flags, | |||||
name, error, warning, wallet); | |||||
result = MakeWallet(wallet); | |||||
return status; | |||||
} | |||||
std::unique_ptr<Handler> handleInitMessage(InitMessageFn fn) override { | std::unique_ptr<Handler> handleInitMessage(InitMessageFn fn) override { | ||||
return MakeHandler(::uiInterface.InitMessage_connect(fn)); | return MakeHandler(::uiInterface.InitMessage_connect(fn)); | ||||
} | } | ||||
std::unique_ptr<Handler> handleMessageBox(MessageBoxFn fn) override { | std::unique_ptr<Handler> handleMessageBox(MessageBoxFn fn) override { | ||||
return MakeHandler(::uiInterface.ThreadSafeMessageBox_connect(fn)); | return MakeHandler(::uiInterface.ThreadSafeMessageBox_connect(fn)); | ||||
} | } | ||||
std::unique_ptr<Handler> handleQuestion(QuestionFn fn) override { | std::unique_ptr<Handler> handleQuestion(QuestionFn fn) override { | ||||
return MakeHandler(::uiInterface.ThreadSafeQuestion_connect(fn)); | return MakeHandler(::uiInterface.ThreadSafeQuestion_connect(fn)); | ||||
▲ Show 20 Lines • Show All 55 Lines • Show Last 20 Lines |