Skip to content

Commit

Permalink
Implement and connect CWallet::GetPathToFile to GUI.
Browse files Browse the repository at this point in the history
Co-authored-by: random-zebra <random.zebra@protonmail.com>
  • Loading branch information
furszy and random-zebra committed Jul 21, 2021
1 parent e7aa6bd commit 524103f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/qt/walletmodel.cpp
Expand Up @@ -122,7 +122,7 @@ bool WalletModel::upgradeWallet(std::string& upgradeError)

QString WalletModel::getWalletPath()
{
return QString::fromStdString(GetDataDir().string() + QDir::separator().toLatin1() + wallet->GetName());
return QString::fromStdString(wallet->GetPathToDBFile().string());
}

CAmount WalletModel::getBalance(const CCoinControl* coinControl, bool fIncludeDelegated, bool fUnlockedOnly, bool fIncludeShielded) const
Expand Down
2 changes: 1 addition & 1 deletion src/wallet/db.h
Expand Up @@ -153,7 +153,7 @@ class CWalletDBWrapper
unsigned int nLastSeen;
unsigned int nLastFlushed;
int64_t nLastWalletUpdate;
unsigned int GetUpdateCounter();
fs::path GetPathToFile() { return env->Directory() / strFile; }

private:
/** BerkeleyDB specific */
Expand Down
3 changes: 3 additions & 0 deletions src/wallet/wallet.h
Expand Up @@ -744,6 +744,9 @@ class CWallet : public CCryptoKeyStore, public CValidationInterface
*/
const std::string& GetName() const { return m_name; }

/** Get the path to the wallet's db file */
fs::path GetPathToDBFile() { return dbw->GetPathToFile(); }

/** Construct wallet with specified name and database implementation. */
CWallet(std::string name, std::unique_ptr<CWalletDBWrapper> dbw_in);
~CWallet();
Expand Down

0 comments on commit 524103f

Please sign in to comment.