diff options
| author | João Barbosa <[email protected]> | 2020-06-12 10:55:20 +0100 |
|---|---|---|
| committer | João Barbosa <[email protected]> | 2020-06-13 01:09:15 +0100 |
| commit | ccf1f6ea24905876f35e685204cb2293cf083e97 (patch) | |
| tree | 046963a42ec15b556ca6cde26a78998802c9e180 /src | |
| parent | Merge #19177: test: Fix and clean p2p_invalid_messages functional tests (diff) | |
| download | discoin-ccf1f6ea24905876f35e685204cb2293cf083e97.tar.xz discoin-ccf1f6ea24905876f35e685204cb2293cf083e97.zip | |
refactor: Drop ::HasWallets()
Diffstat (limited to 'src')
| -rw-r--r-- | src/wallet/rpcwallet.cpp | 2 | ||||
| -rw-r--r-- | src/wallet/wallet.cpp | 6 | ||||
| -rw-r--r-- | src/wallet/wallet.h | 1 |
3 files changed, 1 insertions, 8 deletions
diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 0907f2aab..c3a64cf46 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -106,7 +106,7 @@ std::shared_ptr<CWallet> GetWalletForJSONRPCRequest(const JSONRPCRequest& reques return wallets[0]; } - if (!HasWallets()) { + if (wallets.empty()) { throw JSONRPCError( RPC_METHOD_NOT_FOUND, "Method not found (wallet method is disabled because no wallet is loaded)"); } diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index a59aa8b98..5f318f92a 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -77,12 +77,6 @@ bool RemoveWallet(const std::shared_ptr<CWallet>& wallet) return true; } -bool HasWallets() -{ - LOCK(cs_wallets); - return !vpwallets.empty(); -} - std::vector<std::shared_ptr<CWallet>> GetWallets() { LOCK(cs_wallets); diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h index 67331dc3b..cf000b0b7 100644 --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -51,7 +51,6 @@ void UnloadWallet(std::shared_ptr<CWallet>&& wallet); bool AddWallet(const std::shared_ptr<CWallet>& wallet); bool RemoveWallet(const std::shared_ptr<CWallet>& wallet); -bool HasWallets(); std::vector<std::shared_ptr<CWallet>> GetWallets(); std::shared_ptr<CWallet> GetWallet(const std::string& name); std::shared_ptr<CWallet> LoadWallet(interfaces::Chain& chain, const WalletLocation& location, bilingual_str& error, std::vector<bilingual_str>& warnings); |