Skip to content
Permalink
Browse files

Trivial: add doxygen-compatible comments relating to BerkeleyEnvironment

  • Loading branch information...
PierreRochard committed Sep 14, 2018
2 parents a35b4ef + 9616f62 commit ea7f8291dab051cceb2751ef40f7d2a0ee67f95c
Showing with 8 additions and 1 deletion.
  1. +8 −0 src/wallet/db.cpp
  2. +0 −1 src/wallet/db.h
@@ -56,6 +56,13 @@ CCriticalSection cs_db;
std::map<std::string, std::weak_ptr<BerkeleyEnvironment>> g_dbenvs GUARDED_BY(cs_db); //!< Map from directory name to db environment.
} // namespace

/**
* @param[in] wallet_path Either the path for a wallet file or for a directory containing one or more wallet files.
* @param[out] database_filename Assigned to the wallet file name, defaults to wallet.dat if wallet_path is a directory.
* @return A shared pointer to the BerkeleyEnvironment object, never empty because ~BerkeleyEnvironment
* erases the weak pointer from the g_dbenvs map.
* @post A new BerkeleyEnvironment weak pointer is inserted into g_dbenvs if the directory path key was not already in the map.
*/
std::shared_ptr<BerkeleyEnvironment> GetWalletEnv(const fs::path& wallet_path, std::string& database_filename)
{
fs::path env_directory;
@@ -202,6 +209,7 @@ bool BerkeleyEnvironment::Open(bool retry)
return true;
}

//! Construct an in-memory mock Berkeley environment for testing and as a place-holder for g_dbenvs emplace
BerkeleyEnvironment::BerkeleyEnvironment()
{
Reset();
@@ -86,7 +86,6 @@ class BerkeleyEnvironment
}
};

/** Get BerkeleyEnvironment and database filename given a wallet path. */
std::shared_ptr<BerkeleyEnvironment> GetWalletEnv(const fs::path& wallet_path, std::string& database_filename);

/** An instance of this class represents one database.

0 comments on commit ea7f829

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.