aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces
diff options
context:
space:
mode:
Diffstat (limited to 'src/interfaces')
-rw-r--r--src/interfaces/chain.cpp2
-rw-r--r--src/interfaces/chain.h5
-rw-r--r--src/interfaces/node.cpp2
3 files changed, 8 insertions, 1 deletions
diff --git a/src/interfaces/chain.cpp b/src/interfaces/chain.cpp
index 9f02514df3..725b485e51 100644
--- a/src/interfaces/chain.cpp
+++ b/src/interfaces/chain.cpp
@@ -6,6 +6,7 @@
#include <chain.h>
#include <chainparams.h>
+#include <interfaces/wallet.h>
#include <net.h>
#include <policy/fees.h>
#include <policy/policy.h>
@@ -251,6 +252,7 @@ public:
void initMessage(const std::string& message) override { ::uiInterface.InitMessage(message); }
void initWarning(const std::string& message) override { InitWarning(message); }
void initError(const std::string& message) override { InitError(message); }
+ void loadWallet(std::unique_ptr<Wallet> wallet) override { ::uiInterface.LoadWallet(wallet); }
};
} // namespace
diff --git a/src/interfaces/chain.h b/src/interfaces/chain.h
index be486bd4fc..116656fef4 100644
--- a/src/interfaces/chain.h
+++ b/src/interfaces/chain.h
@@ -24,6 +24,8 @@ struct FeeCalculation;
namespace interfaces {
+class Wallet;
+
//! Interface for giving wallet processes access to blockchain state.
class Chain
{
@@ -187,6 +189,9 @@ public:
//! Send init error.
virtual void initError(const std::string& message) = 0;
+
+ //! Send wallet load notification to the GUI.
+ virtual void loadWallet(std::unique_ptr<Wallet> wallet) = 0;
};
//! Interface to let node manage chain clients (wallets, or maybe tools for
diff --git a/src/interfaces/node.cpp b/src/interfaces/node.cpp
index 96bde7e9f2..6f7dce0c24 100644
--- a/src/interfaces/node.cpp
+++ b/src/interfaces/node.cpp
@@ -275,7 +275,7 @@ public:
}
std::unique_ptr<Handler> handleLoadWallet(LoadWalletFn fn) override
{
- return MakeHandler(::uiInterface.LoadWallet_connect([fn](std::shared_ptr<CWallet> wallet) { fn(MakeWallet(wallet)); }));
+ return MakeHandler(::uiInterface.LoadWallet_connect([fn](std::unique_ptr<Wallet>& wallet) { fn(std::move(wallet)); }));
}
std::unique_ptr<Handler> handleNotifyNumConnectionsChanged(NotifyNumConnectionsChangedFn fn) override
{