Skip to content

Commit 14bc2a1

Browse files
committed
Trivial: add doxygen-compatible comments relating to BerkeleyEnvironment
1 parent 88b1d95 commit 14bc2a1

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/wallet/db.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,13 @@ bool IsWalletLoaded(const fs::path& wallet_path)
8484
return database && database->IsDatabaseLoaded(database_filename);
8585
}
8686

87+
/**
88+
* @param[in] wallet_path Path to wallet directory. Or (for backwards compatibility only) a path to a berkeley btree data file inside a wallet directory.
89+
* @param[out] database_filename Filename of berkeley btree data file inside the wallet directory.
90+
* @return A shared pointer to the BerkeleyEnvironment object for the wallet directory, never empty because ~BerkeleyEnvironment
91+
* erases the weak pointer from the g_dbenvs map.
92+
* @post A new BerkeleyEnvironment weak pointer is inserted into g_dbenvs if the directory path key was not already in the map.
93+
*/
8794
std::shared_ptr<BerkeleyEnvironment> GetWalletEnv(const fs::path& wallet_path, std::string& database_filename)
8895
{
8996
fs::path env_directory;
@@ -218,6 +225,7 @@ bool BerkeleyEnvironment::Open(bool retry)
218225
return true;
219226
}
220227

228+
//! Construct an in-memory mock Berkeley environment for testing and as a place-holder for g_dbenvs emplace
221229
BerkeleyEnvironment::BerkeleyEnvironment()
222230
{
223231
Reset();

0 commit comments

Comments
 (0)