diff options
| author | bitflash <admin@bitflash.network> | 2026-08-17 17:45:01 -0300 |
|---|---|---|
| committer | bitflash <admin@bitflash.network> | 2026-08-17 17:45:01 -0300 |
| commit | 2a2b9d74f8fb6b5d86d750e6e5d18c942738f95c (patch) | |
| tree | 0e372514ce835c74e912d6d7094fb7b84c6a94a0 /src/db.h | |
| parent | a6eb8dab830be3135c054ae3ae442886f1867b4e (diff) | |
wallet: run the node on a SQLite backend (opt-in)
Adds -walletbackend=sqlite: an opt-in flag that runs the node on
<datadir>/wallet.sqlite instead of wallet.dat. It requires an export to
exist first (no silent migration) and prints a step-by-step guide when
one does not; wallet.dat is never opened or touched, so a plain restart
goes back to Berkeley DB.
- LoadWalletFromSQLiteRuntime opens the export read-write, keeps the
handle open as the active backend, loads records into memory through
the same visitor/reconcile/finish path as the read-only staging load,
and never fabricates a default key.
- Shutdown checkpoints and closes the SQLite backend; a kill before that
loses nothing because WAL + synchronous=FULL already made every
committed write durable.
- Self-test proves runtime writes persist across a close and reopen.
BDB stays the default: nothing activates the SQLite runtime unless the
flag is given. One-shot audit/recovery commands still use Berkeley DB.
Diffstat (limited to 'src/db.h')
| -rw-r--r-- | src/db.h | 1 |
1 files changed, 1 insertions, 0 deletions
| @@ -624,6 +624,7 @@ bool ScanWalletRecords(CWalletRecordVisitor& visitor, string& strErrorRet); | |||
| 624 | 624 | ||
| 625 | bool LoadWallet(); | 625 | bool LoadWallet(); |
| 626 | bool LoadWalletFromSQLite(const string& strPath); | 626 | bool LoadWalletFromSQLite(const string& strPath); |
| 627 | bool LoadWalletFromSQLiteRuntime(const string& strPath); | ||
| 627 | 628 | ||
| 628 | // Writes a wallet.dat that opens on its own, anywhere -- see the definition in | 629 | // Writes a wallet.dat that opens on its own, anywhere -- see the definition in |
| 629 | // db.cpp for why a plain file copy does not. Still a point-in-time snapshot: | 630 | // db.cpp for why a plain file copy does not. Still a point-in-time snapshot: |