diff options
author | Russell Yanofsky <russ@yanofsky.org> | 2017-04-17 15:10:47 -0400 |
---|---|---|
committer | John Newbery <john@johnnewbery.com> | 2018-04-04 16:52:40 -0400 |
commit | 5fba3af21e44ab7552c57782de430c1f4cfd6697 (patch) | |
tree | dd34ef0bbf69f24f9bd4cc2a615a0398e6cf79a9 /src/interface/node.cpp | |
parent | c2f672fb1960399389dea9cdd8f76d7156c2c88b (diff) | |
download | bitcoin-5fba3af21e44ab7552c57782de430c1f4cfd6697.tar.xz |
Remove direct bitcoin calls from qt/splashscreen.cpp
Diffstat (limited to 'src/interface/node.cpp')
-rw-r--r-- | src/interface/node.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/interface/node.cpp b/src/interface/node.cpp index 43bdfbaebc..5f4f0f2fa7 100644 --- a/src/interface/node.cpp +++ b/src/interface/node.cpp @@ -7,6 +7,7 @@ #include <chainparams.h> #include <init.h> #include <interface/handler.h> +#include <interface/wallet.h> #include <net.h> #include <netaddress.h> #include <netbase.h> @@ -15,8 +16,19 @@ #include <util.h> #include <warnings.h> +#if defined(HAVE_CONFIG_H) +#include <config/bitcoin-config.h> +#endif +#ifdef ENABLE_WALLET +#define CHECK_WALLET(x) x +#else +#define CHECK_WALLET(x) throw std::logic_error("Wallet function called in non-wallet build.") +#endif + #include <boost/thread/thread.hpp> +class CWallet; + namespace interface { namespace { @@ -69,6 +81,15 @@ class NodeImpl : public Node { return MakeHandler(::uiInterface.ThreadSafeQuestion.connect(fn)); } + std::unique_ptr<Handler> handleShowProgress(ShowProgressFn fn) override + { + return MakeHandler(::uiInterface.ShowProgress.connect(fn)); + } + std::unique_ptr<Handler> handleLoadWallet(LoadWalletFn fn) override + { + CHECK_WALLET( + return MakeHandler(::uiInterface.LoadWallet.connect([fn](CWallet* wallet) { fn(MakeWallet(*wallet)); }))); + } }; } // namespace |