Changeset View
Changeset View
Standalone View
Standalone View
src/interfaces/node.cpp
Show All 39 Lines | |||||
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::vector<std::string> &warnings); | ||||
WalletCreationStatus | WalletCreationStatus CreateWallet(const CChainParams ¶ms, | ||||
CreateWallet(const CChainParams ¶ms, interfaces::Chain &chain, | interfaces::Chain &chain, | ||||
const SecureString &passphrase, uint64_t wallet_creation_flags, | const SecureString &passphrase, | ||||
const std::string &name, std::string &error, std::string &warning, | uint64_t wallet_creation_flags, | ||||
const std::string &name, std::string &error, | |||||
std::vector<std::string> &warnings, | |||||
std::shared_ptr<CWallet> &result); | 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 213 Lines • ▼ Show 20 Lines | public: | ||||
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> | 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::vector<std::string> &warnings) const override { | |||||
return MakeWallet( | return MakeWallet( | ||||
LoadWallet(params, *m_context.chain, name, error, warning)); | LoadWallet(params, *m_context.chain, name, error, warnings)); | ||||
} | } | ||||
WalletCreationStatus | WalletCreationStatus | ||||
createWallet(const CChainParams ¶ms, const SecureString &passphrase, | createWallet(const CChainParams ¶ms, const SecureString &passphrase, | ||||
uint64_t wallet_creation_flags, const std::string &name, | uint64_t wallet_creation_flags, const std::string &name, | ||||
std::string &error, std::string &warning, | std::string &error, std::vector<std::string> &warnings, | ||||
std::unique_ptr<Wallet> &result) override { | std::unique_ptr<Wallet> &result) override { | ||||
std::shared_ptr<CWallet> wallet; | std::shared_ptr<CWallet> wallet; | ||||
WalletCreationStatus status = CreateWallet( | WalletCreationStatus status = CreateWallet( | ||||
params, *m_context.chain, passphrase, wallet_creation_flags, | params, *m_context.chain, passphrase, wallet_creation_flags, | ||||
name, error, warning, wallet); | name, error, warnings, wallet); | ||||
result = MakeWallet(wallet); | result = MakeWallet(wallet); | ||||
return status; | 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)); | ||||
▲ Show 20 Lines • Show All 58 Lines • Show Last 20 Lines |