diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -23,9 +23,9 @@ #include #ifdef ENABLE_WALLET +#include +#include #include - -#include #endif #include @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -555,7 +556,8 @@ // set library version labels #ifdef ENABLE_WALLET - ui->berkeleyDBVersion->setText(DbEnv::version(nullptr, nullptr, nullptr)); + ui->berkeleyDBVersion->setText( + QString::fromStdString(BerkeleyDatabaseVersion())); #else ui->label_berkeleyDBVersion->hide(); ui->berkeleyDBVersion->hide(); diff --git a/src/wallet/bdb.h b/src/wallet/bdb.h --- a/src/wallet/bdb.h +++ b/src/wallet/bdb.h @@ -243,4 +243,6 @@ bool TxnAbort() override; }; +std::string BerkeleyDatabaseVersion(); + #endif // BITCOIN_WALLET_BDB_H diff --git a/src/wallet/bdb.cpp b/src/wallet/bdb.cpp --- a/src/wallet/bdb.cpp +++ b/src/wallet/bdb.cpp @@ -297,8 +297,7 @@ fs::path walletDir = env->Directory(); fs::path file_path = walletDir / strFile; - 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()); if (!env->Open(errorStr)) { @@ -825,6 +824,10 @@ return (ret == 0); } +std::string BerkeleyDatabaseVersion() { + return DbEnv::version(nullptr, nullptr, nullptr); +} + bool BerkeleyBatch::ReadKey(CDataStream &&key, CDataStream &value) { if (!pdb) { return false;