diff options
| author | Jonas Schnelli <[email protected]> | 2018-06-21 16:24:01 +0200 |
|---|---|---|
| committer | Jonas Schnelli <[email protected]> | 2018-06-21 16:24:31 +0200 |
| commit | 000abbb6b07410357a928768d7d56465ba0d3bac (patch) | |
| tree | 0cc9241398af02cac96e85876b45ca101cb52656 /src/interfaces | |
| parent | Merge #13506: Qt: load wallet in UI after possible init aborts (diff) | |
| parent | bugfix: Delete walletView in WalletFrame::removeWallet (diff) | |
| download | discoin-000abbb6b07410357a928768d7d56465ba0d3bac.tar.xz discoin-000abbb6b07410357a928768d7d56465ba0d3bac.zip | |
Merge #13111: Add unloadwallet RPC
fe65bdec2 bugfix: Delete walletView in WalletFrame::removeWallet (João Barbosa)
0b82bac76 bugfix: Remove dangling wallet env instance (João Barbosa)
0ee77b207 ui: Support wallets unloaded dynamically (João Barbosa)
9f9b50d5f doc: Add release notes for unloadwallet RPC (João Barbosa)
ccbf7ae74 test: Wallet methods are disabled when no wallet is loaded (João Barbosa)
4940a20a4 test: Add functional tests for unloadwallet RPC (João Barbosa)
6608c369b rpc: Add unloadwallet RPC (João Barbosa)
537efe19e rpc: Extract GetWalletNameFromJSONRPCRequest from GetWalletForJSONRPCRequest (João Barbosa)
Pull request description:
This patch adds wallet unload feature via RPC. It also adds UI support for unloaded wallets.
Tree-SHA512: 7c7f9f32f7a2266d2df574aa6b95f993c3dc82736f93304562122beb8756fb28cd22d03866b48f493c747441f22d30e196b098dec435cc25e035633f090351ea
Diffstat (limited to 'src/interfaces')
| -rw-r--r-- | src/interfaces/wallet.cpp | 4 | ||||
| -rw-r--r-- | src/interfaces/wallet.h | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/interfaces/wallet.cpp b/src/interfaces/wallet.cpp index 3029dbe8e..e98acba0d 100644 --- a/src/interfaces/wallet.cpp +++ b/src/interfaces/wallet.cpp @@ -429,6 +429,10 @@ public: bool hdEnabled() override { return m_wallet.IsHDEnabled(); } OutputType getDefaultAddressType() override { return m_wallet.m_default_address_type; } OutputType getDefaultChangeType() override { return m_wallet.m_default_change_type; } + std::unique_ptr<Handler> handleUnload(UnloadFn fn) override + { + return MakeHandler(m_wallet.NotifyUnload.connect(fn)); + } std::unique_ptr<Handler> handleShowProgress(ShowProgressFn fn) override { return MakeHandler(m_wallet.ShowProgress.connect(fn)); diff --git a/src/interfaces/wallet.h b/src/interfaces/wallet.h index 82ae0b14b..ce42e14ee 100644 --- a/src/interfaces/wallet.h +++ b/src/interfaces/wallet.h @@ -242,6 +242,10 @@ public: // Get default change type. virtual OutputType getDefaultChangeType() = 0; + //! Register handler for unload message. + using UnloadFn = std::function<void()>; + virtual std::unique_ptr<Handler> handleUnload(UnloadFn fn) = 0; + //! Register handler for show progress messages. using ShowProgressFn = std::function<void(const std::string& title, int progress)>; virtual std::unique_ptr<Handler> handleShowProgress(ShowProgressFn fn) = 0; |