diff options
author | stoffu <stoffu@protonmail.ch> | 2018-03-27 12:08:28 +0900 |
---|---|---|
committer | stoffu <stoffu@protonmail.ch> | 2018-05-31 08:16:45 +0900 |
commit | 0da5d37bf3e324550a002dcad39a3e816bc15cf1 (patch) | |
tree | 6a8e713c2fa4648389863f829a3394692b4933af /src/wallet/api/wallet.cpp | |
parent | Merge pull request #3525 (diff) | |
download | monero-0da5d37bf3e324550a002dcad39a3e816bc15cf1.tar.xz |
wallet: fix shared ring db path
Diffstat (limited to '')
-rw-r--r-- | src/wallet/api/wallet.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/wallet/api/wallet.cpp b/src/wallet/api/wallet.cpp index 367011eaa..059d7f3b5 100644 --- a/src/wallet/api/wallet.cpp +++ b/src/wallet/api/wallet.cpp @@ -69,12 +69,16 @@ namespace { // Connection timeout 30 sec static const int DEFAULT_CONNECTION_TIMEOUT_MILLIS = 1000 * 30; - std::string get_default_ringdb_path() + std::string get_default_ringdb_path(cryptonote::network_type nettype) { boost::filesystem::path dir = tools::get_default_data_dir(); // remove .bitmonero, replace with .shared-ringdb dir = dir.remove_filename(); dir /= ".shared-ringdb"; + if (nettype == cryptonote::TESTNET) + dir /= "testnet"; + else if (nettype == cryptonote::STAGENET) + dir /= "stagenet"; return dir.string(); } } @@ -599,7 +603,7 @@ bool WalletImpl::open(const std::string &path, const std::string &password) // Rebuilding wallet cache, using refresh height from .keys file m_rebuildWalletCache = true; } - m_wallet->set_ring_database(get_default_ringdb_path()); + m_wallet->set_ring_database(get_default_ringdb_path(m_wallet->nettype())); m_wallet->load(path, password); m_password = password; |