aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/node.cpp
diff options
context:
space:
mode:
authorAndrew Chow <achow101-github@achow101.com>2019-05-24 17:14:16 -0400
committerAndrew Chow <achow101-github@achow101.com>2019-09-05 20:36:57 -0400
commit9b41cbb28f603f4f71f5854d6ae2527932bba3cb (patch)
tree2b88b292c10566b75c0df9128ffc8ad913e2635e /src/interfaces/node.cpp
parent78863e290006e61060622dbdbecc5b58c0fefa05 (diff)
Expose wallet creation to the GUI via WalletController
Co-authored-by: João Barbosa <joao.paulo.barbosa@gmail.com>
Diffstat (limited to 'src/interfaces/node.cpp')
-rw-r--r--src/interfaces/node.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/interfaces/node.cpp b/src/interfaces/node.cpp
index fc49817502..ccafc3ac8c 100644
--- a/src/interfaces/node.cpp
+++ b/src/interfaces/node.cpp
@@ -24,6 +24,7 @@
#include <primitives/block.h>
#include <rpc/server.h>
#include <shutdown.h>
+#include <support/allocators/secure.h>
#include <sync.h>
#include <txmempool.h>
#include <ui_interface.h>
@@ -43,6 +44,7 @@ fs::path GetWalletDir();
std::vector<fs::path> ListWalletDir();
std::vector<std::shared_ptr<CWallet>> GetWallets();
std::shared_ptr<CWallet> LoadWallet(interfaces::Chain& chain, const std::string& name, std::string& error, std::string& warning);
+WalletCreationStatus CreateWallet(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 {
@@ -258,6 +260,13 @@ public:
{
return MakeWallet(LoadWallet(*m_interfaces.chain, name, error, warning));
}
+ WalletCreationStatus createWallet(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(*m_interfaces.chain, passphrase, wallet_creation_flags, name, error, warning, wallet);
+ result = MakeWallet(wallet);
+ return status;
+ }
std::unique_ptr<Handler> handleInitMessage(InitMessageFn fn) override
{
return MakeHandler(::uiInterface.InitMessage_connect(fn));