add timeouts so syncing wallet never hangs the UI

This commit is contained in:
2026-08-02 14:54:39 +08:00
parent 4270d380fb
commit 11e0bcdaf6
5 changed files with 203 additions and 55 deletions
+8 -1
View File
@@ -108,12 +108,19 @@ export function createMoneroHandlers(state: {
console.log('[rpc] moneroRestoreWallet:', name)
if (!state.manager)
throw new Error('Monero wallet RPC not started')
// Default to ~2 days of history instead of a full genesis scan
// (which can take hours against a remote daemon).
let height = restoreHeight
if (!height || height === 0) {
const tip = await walletGetDaemonHeight(state.manager)
if (tip > 1440) height = tip - 1440
}
await walletRestore(
state.manager,
name,
password,
mnemonic,
restoreHeight,
height,
)
const address = await walletGetAddress(state.manager)
console.log(