Changeset View
Changeset View
Standalone View
Standalone View
src/qt/walletcontroller.cpp
Show All 38 Lines | WalletController::~WalletController() { | ||||
m_activity_thread.wait(); | m_activity_thread.wait(); | ||||
} | } | ||||
std::vector<WalletModel *> WalletController::getWallets() const { | std::vector<WalletModel *> WalletController::getWallets() const { | ||||
QMutexLocker locker(&m_mutex); | QMutexLocker locker(&m_mutex); | ||||
return m_wallets; | return m_wallets; | ||||
} | } | ||||
std::vector<std::string> WalletController::getWalletsAvailableToOpen() const { | std::map<std::string, bool> WalletController::listWalletDir() const { | ||||
QMutexLocker locker(&m_mutex); | QMutexLocker locker(&m_mutex); | ||||
std::vector<std::string> wallets = m_node.listWalletDir(); | std::map<std::string, bool> wallets; | ||||
for (const std::string &name : m_node.listWalletDir()) { | |||||
wallets[name] = false; | |||||
} | |||||
for (WalletModel *wallet_model : m_wallets) { | for (WalletModel *wallet_model : m_wallets) { | ||||
auto it = std::remove(wallets.begin(), wallets.end(), | auto it = wallets.find(wallet_model->wallet().getWalletName()); | ||||
wallet_model->wallet().getWalletName()); | |||||
if (it != wallets.end()) { | if (it != wallets.end()) { | ||||
wallets.erase(it); | it->second = true; | ||||
} | } | ||||
} | } | ||||
return wallets; | return wallets; | ||||
} | } | ||||
OpenWalletActivity *WalletController::openWallet(const CChainParams ¶ms, | OpenWalletActivity *WalletController::openWallet(const CChainParams ¶ms, | ||||
const std::string &name, | const std::string &name, | ||||
QWidget *parent) { | QWidget *parent) { | ||||
▲ Show 20 Lines • Show All 120 Lines • Show Last 20 Lines |