summaryrefslogtreecommitdiffstats
path: root/src/app.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-06-25 00:30:03 -0700
committerAdam Soltys <[email protected]>2026-06-25 00:30:03 -0700
commit554716b916c5b4c4ca39bf6344f840c62a0da54a (patch)
tree3d5879ecb50b9dca00a0e4d32a661d3a765ac00e /src/app.js
parenta1c20acc78df310e1d805e14c649bc1731e60e9d (diff)
downloadcoinosv3-554716b916c5b4c4ca39bf6344f840c62a0da54a.tar.gz
coinosv3-554716b916c5b4c4ca39bf6344f840c62a0da54a.zip
Fast-poll the receive address while watching for a payment
The WS badge reads Live but mempool.space's free address tracking doesn't reliably push incoming mempool txs, so a deposit could take ~18s to appear (the 25s safety poll catching it). While the user is on the Receive tab (online), now poll just the fresh receive address every ~3s regardless of Live state — one cheap request that guarantees near-instant arrival. Toggled idempotently from render() based on the active tab; stops when they navigate away. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Diffstat (limited to 'src/app.js')
-rw-r--r--src/app.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/app.js b/src/app.js
index 53e118e..9c9c22a 100644
--- a/src/app.js
+++ b/src/app.js
@@ -233,6 +233,9 @@ function render() {
? howItWorksScreen()
: unlockScreen();
root.replaceChildren(screen, footer());
+ // Fast-poll the receive address only while the user is actually watching for a
+ // payment (wallet screen, Receive tab, online). Idempotent — safe each render.
+ wallet.setWatchReceive(ui.screen === 'wallet' && ui.tab === 'receive' && !wallet.offline);
}
wallet.subscribe(render);