Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/xrpld/app/rdb/backend/detail/SQLiteDatabase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,21 +196,33 @@ class SQLiteDatabaseImp final : public SQLiteDatabase
* @brief checkoutTransaction Checks out and returns node store ledger
* database.
* @return Session to the node store ledger database.
* @throws std::runtime_error if ledger database is not available.
*/
auto
checkoutLedger()
{
if (!lgrdb_)
{
JLOG(j_.fatal()) << "Ledger database is not available";
Throw<std::runtime_error>("Ledger database is not available");
}
return lgrdb_->checkoutDb();
}

/**
* @brief checkoutTransaction Checks out and returns the node store
* transaction database.
* @return Session to the node store transaction database.
* @throws std::runtime_error if transaction database is not available.
*/
auto
checkoutTransaction()
{
if (!txdb_)
{
JLOG(j_.fatal()) << "Transaction database is not available";
Throw<std::runtime_error>("Transaction database is not available");
}
return txdb_->checkoutDb();
}
};
Expand Down