Changeset View
Changeset View
Standalone View
Standalone View
src/interfaces/node.cpp
Show All 39 Lines | |||||
#include <atomic> | #include <atomic> | ||||
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, | |||||
interfaces::Chain &chain, | |||||
const std::string &name, std::string &error, | |||||
std::string &warning); | |||||
namespace interfaces { | namespace interfaces { | ||||
class Wallet; | class Wallet; | ||||
namespace { | namespace { | ||||
class NodeImpl : public Node { | class NodeImpl : public Node { | ||||
▲ Show 20 Lines • Show All 209 Lines • ▼ Show 20 Lines | public: | ||||
} | } | ||||
std::vector<std::unique_ptr<Wallet>> getWallets() override { | std::vector<std::unique_ptr<Wallet>> getWallets() override { | ||||
std::vector<std::unique_ptr<Wallet>> wallets; | std::vector<std::unique_ptr<Wallet>> wallets; | ||||
for (const std::shared_ptr<CWallet> &wallet : GetWallets()) { | for (const std::shared_ptr<CWallet> &wallet : GetWallets()) { | ||||
wallets.emplace_back(MakeWallet(wallet)); | wallets.emplace_back(MakeWallet(wallet)); | ||||
} | } | ||||
return wallets; | return wallets; | ||||
} | } | ||||
std::unique_ptr<Wallet> | |||||
loadWallet(const CChainParams ¶ms, const std::string &name, | |||||
std::string &error, std::string &warning) const override { | |||||
return MakeWallet( | |||||
LoadWallet(params, *m_interfaces.chain, name, error, warning)); | |||||
} | |||||
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 54 Lines • Show Last 20 Lines |