Keep Monero scan progress across app restarts

This commit is contained in:
2026-09-19 22:17:00 +08:00
parent f4037a188a
commit 807388ea6b
4 changed files with 60 additions and 19 deletions
@@ -145,6 +145,16 @@ static void connectDaemon(monero_wallet_full *w) {
delete g_wallet;
g_wallet = nullptr;
}
} else if ([op isEqualToString:@"saveWallet"]) {
// monero-cpp never persists while syncing, so scan progress survives a
// restart only if this is called explicitly. save() pauses the sync
// thread while it writes.
if (g_wallet) {
g_wallet->save();
resp[@"saved"] = @YES;
} else {
resp[@"error"] = @"No wallet open";
}
} else if ([op isEqualToString:@"getBalance"]) {
if (g_wallet) {
uint64_t balance = 0, unlocked = 0;