mirror of
https://github.com/bitcoin/bitcoin.git
synced 2024-11-20 10:38:42 +01:00
refactor: Add BerkeleyDatabaseVersion() function
This commit is contained in:
parent
eb2ffbb7c1
commit
de5e91c303
@ -24,7 +24,7 @@
|
|||||||
#include <univalue.h>
|
#include <univalue.h>
|
||||||
|
|
||||||
#ifdef ENABLE_WALLET
|
#ifdef ENABLE_WALLET
|
||||||
#include <db_cxx.h>
|
#include <wallet/db.h>
|
||||||
#include <wallet/wallet.h>
|
#include <wallet/wallet.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -34,9 +34,10 @@
|
|||||||
#include <QScrollBar>
|
#include <QScrollBar>
|
||||||
#include <QScreen>
|
#include <QScreen>
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
|
#include <QString>
|
||||||
|
#include <QStringList>
|
||||||
#include <QTime>
|
#include <QTime>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QStringList>
|
|
||||||
|
|
||||||
// TODO: add a scrollback limit, as there is currently none
|
// TODO: add a scrollback limit, as there is currently none
|
||||||
// TODO: make it possible to filter out categories (esp debug messages when implemented)
|
// TODO: make it possible to filter out categories (esp debug messages when implemented)
|
||||||
@ -480,7 +481,7 @@ RPCConsole::RPCConsole(interfaces::Node& node, const PlatformStyle *_platformSty
|
|||||||
|
|
||||||
// set library version labels
|
// set library version labels
|
||||||
#ifdef ENABLE_WALLET
|
#ifdef ENABLE_WALLET
|
||||||
ui->berkeleyDBVersion->setText(DbEnv::version(nullptr, nullptr, nullptr));
|
ui->berkeleyDBVersion->setText(QString::fromStdString(BerkeleyDatabaseVersion()));
|
||||||
#else
|
#else
|
||||||
ui->label_berkeleyDBVersion->hide();
|
ui->label_berkeleyDBVersion->hide();
|
||||||
ui->berkeleyDBVersion->hide();
|
ui->berkeleyDBVersion->hide();
|
||||||
|
@ -399,7 +399,7 @@ bool BerkeleyBatch::VerifyEnvironment(const fs::path& file_path, bilingual_str&
|
|||||||
std::shared_ptr<BerkeleyEnvironment> env = GetWalletEnv(file_path, walletFile);
|
std::shared_ptr<BerkeleyEnvironment> env = GetWalletEnv(file_path, walletFile);
|
||||||
fs::path walletDir = env->Directory();
|
fs::path walletDir = env->Directory();
|
||||||
|
|
||||||
LogPrintf("Using BerkeleyDB version %s\n", DbEnv::version(nullptr, nullptr, nullptr));
|
LogPrintf("Using BerkeleyDB version %s\n", BerkeleyDatabaseVersion());
|
||||||
LogPrintf("Using wallet %s\n", file_path.string());
|
LogPrintf("Using wallet %s\n", file_path.string());
|
||||||
|
|
||||||
if (!env->Open(true /* retry */)) {
|
if (!env->Open(true /* retry */)) {
|
||||||
@ -916,3 +916,8 @@ void BerkeleyDatabase::ReloadDbEnv()
|
|||||||
env->ReloadDbEnv();
|
env->ReloadDbEnv();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string BerkeleyDatabaseVersion()
|
||||||
|
{
|
||||||
|
return DbEnv::version(nullptr, nullptr, nullptr);
|
||||||
|
}
|
||||||
|
@ -402,4 +402,6 @@ public:
|
|||||||
bool static Rewrite(BerkeleyDatabase& database, const char* pszSkip = nullptr);
|
bool static Rewrite(BerkeleyDatabase& database, const char* pszSkip = nullptr);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
std::string BerkeleyDatabaseVersion();
|
||||||
|
|
||||||
#endif // BITCOIN_WALLET_DB_H
|
#endif // BITCOIN_WALLET_DB_H
|
||||||
|
Loading…
Reference in New Issue
Block a user