mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-13 12:33:42 +02:00
Remove direct bitcoin calls from qt/splashscreen.cpp
This commit is contained in:
parent
c2f672fb19
commit
5fba3af21e
10 changed files with 139 additions and 29 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue