diff options
| author | Nsable-sh <nsable-sh@noreply.git.bitflash.network> | 2026-08-14 18:17:23 -0300 |
|---|---|---|
| committer | Nsable-sh <nsable-sh@noreply.git.bitflash.network> | 2026-08-14 18:17:23 -0300 |
| commit | f9ee957bd6d3f28dfee166a82f389aad666a0119 (patch) | |
| tree | e6ecab8a276afb007f341a498dd1a8553a756b0c /src/main_gui.cpp | |
| parent | c56af18e421dff78446399a630b5fa949fc487b3 (diff) | |
wallet: stage SQLite runtime loading
Diffstat (limited to 'src/main_gui.cpp')
| -rw-r--r-- | src/main_gui.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/main_gui.cpp b/src/main_gui.cpp index c9aac7d..ee875c7 100644 --- a/src/main_gui.cpp +++ b/src/main_gui.cpp | |||
| @@ -189,6 +189,7 @@ static void PrintUsage() | |||
| 189 | printf(" an empty data directory, then exit)\n"); | 189 | printf(" an empty data directory, then exit)\n"); |
| 190 | printf(" /walletsqliteloadcheck=FILE\n"); | 190 | printf(" /walletsqliteloadcheck=FILE\n"); |
| 191 | printf(" (parse a SQLite export like the wallet loader)\n"); | 191 | printf(" (parse a SQLite export like the wallet loader)\n"); |
| 192 | printf(" /walletsqlite=FILE (stage-load a SQLite wallet export, then exit)\n"); | ||
| 192 | printf(" /rescan (walk the chain for coins this wallet owns\n"); | 193 | printf(" /rescan (walk the chain for coins this wallet owns\n"); |
| 193 | printf(" but never recorded, then exit)\n"); | 194 | printf(" but never recorded, then exit)\n"); |
| 194 | printf("\n"); | 195 | printf("\n"); |
| @@ -617,6 +618,27 @@ int main(int argc, char* argv[]) | |||
| 617 | printf("Loading wallet...\n"); | 618 | printf("Loading wallet...\n"); |
| 618 | try | 619 | try |
| 619 | { | 620 | { |
| 621 | string strWalletSQLite = | ||
| 622 | argval2(argc, argv, "/walletsqlite", "-walletsqlite"); | ||
| 623 | if (!strWalletSQLite.empty()) | ||
| 624 | { | ||
| 625 | AttachTerminal(); | ||
| 626 | if (!LoadWalletFromSQLite(strWalletSQLite)) | ||
| 627 | { | ||
| 628 | FatalStartupError(fHeadlessStartup, | ||
| 629 | "Cannot open SQLite wallet export.", | ||
| 630 | strWalletLoadError); | ||
| 631 | return 1; | ||
| 632 | } | ||
| 633 | |||
| 634 | fprintf(stderr, "SQLite wallet loaded: read-only staging backend\n"); | ||
| 635 | fprintf(stderr, "SQLite runtime writes are not enabled yet; exiting before " | ||
| 636 | "network, mining, GUI, or wallet mutation starts.\n"); | ||
| 637 | fflush(stderr); | ||
| 638 | DBFlush(true); | ||
| 639 | return 0; | ||
| 640 | } | ||
| 641 | |||
| 620 | if (!LoadWallet()) | 642 | if (!LoadWallet()) |
| 621 | { | 643 | { |
| 622 | // LoadWallet() explains itself into strWalletLoadError when it | 644 | // LoadWallet() explains itself into strWalletLoadError when it |