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/wallet.cpp | |
parent | c2f672fb1960399389dea9cdd8f76d7156c2c88b (diff) |
Remove direct bitcoin calls from qt/splashscreen.cpp
Diffstat (limited to 'src/interface/wallet.cpp')
-rw-r--r-- | src/interface/wallet.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/interface/wallet.cpp b/src/interface/wallet.cpp new file mode 100644 index 0000000000..01639aa37f --- /dev/null +++ b/src/interface/wallet.cpp @@ -0,0 +1,32 @@ +// Copyright (c) 2018 The Bitcoin Core developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#include <interface/wallet.h> + +#include <interface/handler.h> +#include <wallet/wallet.h> + +#include <memory> + +namespace interface { +namespace { + +class WalletImpl : public Wallet +{ +public: + WalletImpl(CWallet& wallet) : m_wallet(wallet) {} + + std::unique_ptr<Handler> handleShowProgress(ShowProgressFn fn) override + { + return MakeHandler(m_wallet.ShowProgress.connect(fn)); + } + + CWallet& m_wallet; +}; + +} // namespace + +std::unique_ptr<Wallet> MakeWallet(CWallet& wallet) { return MakeUnique<WalletImpl>(wallet); } + +} // namespace interface |