aboutsummaryrefslogtreecommitdiffstats
path: root/src/app.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/app.js')
-rw-r--r--src/app.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/app.js b/src/app.js
index 5f1f412..789f12c 100644
--- a/src/app.js
+++ b/src/app.js
@@ -375,7 +375,7 @@ async function openWallet(mnemonic) {
async function enterWallet(mnemonic, passphrase) {
wallet.load({ mnemonic, passphrase, netName: 'mainnet', offline: false });
persistSession(mnemonic, passphrase);
- wallet.restoreCache(); // show last-known balance/history instantly, if cached
+ const hadCache = wallet.restoreCache(); // show last-known balance/history instantly
ui.screen = 'wallet';
ui.tab = 'receive';
ui.send = blankSend();
@@ -391,7 +391,10 @@ async function enterWallet(mnemonic, passphrase) {
return;
}
try {
- await wallet.scan();
+ // With a cache, only check the live frontier (cheap) instead of a full
+ // re-scan; a full scan still runs for a brand-new wallet and periodically.
+ if (hadCache) await wallet.refreshLive();
+ else await wallet.scan();
wallet.startRealtime();
} catch {
enterOfflineFallback();