aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/node.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/interfaces/node.cpp')
-rw-r--r--src/interfaces/node.cpp20
1 files changed, 7 insertions, 13 deletions
diff --git a/src/interfaces/node.cpp b/src/interfaces/node.cpp
index 1da58fe487..d95b41657c 100644
--- a/src/interfaces/node.cpp
+++ b/src/interfaces/node.cpp
@@ -32,19 +32,18 @@
#if defined(HAVE_CONFIG_H)
#include <config/bitcoin-config.h>
#endif
-#ifdef ENABLE_WALLET
-#include <wallet/fees.h>
-#include <wallet/wallet.h>
-#define CHECK_WALLET(x) x
-#else
-#define CHECK_WALLET(x) throw std::logic_error("Wallet function called in non-wallet build.")
-#endif
#include <atomic>
#include <boost/thread/thread.hpp>
#include <univalue.h>
+class CWallet;
+std::vector<std::shared_ptr<CWallet>> GetWallets();
+
namespace interfaces {
+
+class Wallet;
+
namespace {
class NodeImpl : public Node
@@ -221,15 +220,11 @@ class NodeImpl : public Node
}
std::vector<std::unique_ptr<Wallet>> getWallets() override
{
-#ifdef ENABLE_WALLET
std::vector<std::unique_ptr<Wallet>> wallets;
for (const std::shared_ptr<CWallet>& wallet : GetWallets()) {
wallets.emplace_back(MakeWallet(wallet));
}
return wallets;
-#else
- throw std::logic_error("Node::getWallets() called in non-wallet build.");
-#endif
}
std::unique_ptr<Handler> handleInitMessage(InitMessageFn fn) override
{
@@ -249,8 +244,7 @@ class NodeImpl : public Node
}
std::unique_ptr<Handler> handleLoadWallet(LoadWalletFn fn) override
{
- CHECK_WALLET(
- return MakeHandler(::uiInterface.LoadWallet_connect([fn](std::shared_ptr<CWallet> wallet) { fn(MakeWallet(wallet)); })));
+ return MakeHandler(::uiInterface.LoadWallet_connect([fn](std::shared_ptr<CWallet> wallet) { fn(MakeWallet(wallet)); }));
}
std::unique_ptr<Handler> handleNotifyNumConnectionsChanged(NotifyNumConnectionsChangedFn fn) override
{