bfdb399772
Brings in uncommitted work from SAMI-PC E:\repos\triangles
cpp20-modernization branch:
- RocksDB default chain DB + auto-migrate from txleveldb
- SQLite default wallet + non-destructive migration from Berkeley
- Boost.Asio removed from RPC (rpc_httpsocket.h)
- Boost removed from all daemon + GUI code
- New: walletdb-base.h, walletdb-batch.h, walletdb-sqlite.{h,cpp},
walletdb-factory.{h,cpp}, walletmigrate.{h,cpp}
- New tests: chaindb_runtime_tests, chaindb_equivalence_tests,
snapshotnet_tests
- Docs: BOOST-REMOVAL.md, ROCKSDB-DEFAULT-MIGRATION.md,
WALLET-SQLITE-MIGRATION.md
Does not yet build — needs CWalletDB->CWalletBatchTyped rebase in
walletdb.cpp/wallet.cpp/db.cpp and merge with origin/master for
v6 source files (checkpointpublisher, tor/, snapshot/, utxosnapshot,
bootstrap.cpp).
Build flags: -DBUILD_QT=OFF -DUSE_I2P_EMBEDDED=OFF
32 lines
1.3 KiB
C++
32 lines
1.3 KiB
C++
// Copyright (c) 2026 The Triangles developers.
|
|
// Distributed under the MIT/X11 software license, see the accompanying
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
#ifndef TRIANGLES_WALLETMIGRATE_H
|
|
#define TRIANGLES_WALLETMIGRATE_H
|
|
|
|
#include <filesystem>
|
|
#include <string>
|
|
|
|
// Migrate a Berkeley DB wallet (wallet.dat) to a SQLite wallet of the same
|
|
// name, IN PLACE and NON-DESTRUCTIVELY:
|
|
//
|
|
// 1. If walletPath does not exist, or is already a SQLite database, there is
|
|
// nothing to do — returns true.
|
|
// 2. Otherwise the Berkeley records are copied verbatim (raw key/value bytes)
|
|
// into a fresh SQLite database written to a temporary file.
|
|
// 3. The record count is verified to match.
|
|
// 4. The original Berkeley file is renamed to "<name>.bdb.bak" (kept as a
|
|
// fallback, never deleted), and the SQLite file is moved into place as
|
|
// "<name>".
|
|
//
|
|
// On any failure the original Berkeley wallet is left exactly as it was and the
|
|
// temporary SQLite file is removed; strError describes the problem.
|
|
bool MaybeMigrateBerkeleyWalletToSQLite(const std::filesystem::path& walletPath,
|
|
std::string& strError);
|
|
|
|
// True if the file begins with the SQLite format-3 magic header.
|
|
bool IsSQLiteFile(const std::filesystem::path& path);
|
|
|
|
#endif // TRIANGLES_WALLETMIGRATE_H
|