diff options
author | Wladimir J. van der Laan <laanwj@protonmail.com> | 2021-01-17 17:21:21 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@protonmail.com> | 2021-01-17 18:10:20 +0100 |
commit | ad57fb756b1c2df625790bd9c296ec28daa93740 (patch) | |
tree | 5046596f65379b72d6f563ebe8c95bdf586e1735 /src/wallet/bdb.h | |
parent | 30e664dcce1a9adb9ba9a29e4f0cf809767870dd (diff) | |
download | bitcoin-ad57fb756b1c2df625790bd9c296ec28daa93740.tar.xz |
wallet: Add BerkeleyDB version sanity check at init time
Detect version conflicts between the run-time BerkeleyDB library and the one used during compilation.
This is very unsafe (can result in anything from crashes to corruption) so shut down when one is detected.
Diffstat (limited to 'src/wallet/bdb.h')
-rw-r--r-- | src/wallet/bdb.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/wallet/bdb.h b/src/wallet/bdb.h index bf1617d67f..a8209587d7 100644 --- a/src/wallet/bdb.h +++ b/src/wallet/bdb.h @@ -223,6 +223,10 @@ public: std::string BerkeleyDatabaseVersion(); +/** Perform sanity check of runtime BDB version versus linked BDB version. + */ +bool BerkeleyDatabaseSanityCheck(); + //! Return object giving access to Berkeley database at specified path. std::unique_ptr<BerkeleyDatabase> MakeBerkeleyDatabase(const fs::path& path, const DatabaseOptions& options, DatabaseStatus& status, bilingual_str& error); |