aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-08-17 19:30:05 -0700
committerAdam Soltys <[email protected]>2026-08-17 19:30:05 -0700
commit7045711d9d6a639d0180a049fe0fd7ad61a2fcf3 (patch)
treef45fbeabc2b713898bf94dae4a6b48e032b9a311 /src
parentde727b751c9242eedd41d0ea85299b6e496a6a4c (diff)
downloadcoinosv3-7045711d9d6a639d0180a049fe0fd7ad61a2fcf3.tar.gz
coinosv3-7045711d9d6a639d0180a049fe0fd7ad61a2fcf3.zip
The phantom Spending flag heals itself: off mainnet, a spending side with no balance and no history admits it was never set up
Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01JtaatFfAbx91Nh3xqKVqKz
Diffstat (limited to 'src')
-rw-r--r--src/app.js13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/app.js b/src/app.js
index 5d3b049..2b2497f 100644
--- a/src/app.js
+++ b/src/app.js
@@ -2990,7 +2990,18 @@ const ACCOUNT_KEY = 'btc-wallet-account';
function spendingActive() {
if (!featureHook('arkReady')) return false;
const acc = activeAccount();
- if (acc?.spendingSetup) return true;
+ if (acc?.spendingSetup) {
+ // Self-heal a flag latched by the old cross-network name leak: off
+ // mainnet, a Spending side with zero balance AND no ark history was
+ // never really set up — drop it. A real receive re-latches instantly.
+ if (getNetwork() !== 'mainnet' && !(featureHook('spendingSat') || 0)
+ && !(featureHook('arkMovements') || []).length) {
+ delete acc.spendingSetup;
+ persistAccounts();
+ } else {
+ return true;
+ }
+ }
// A claimed payment address proves spending on MAINNET only: names feature
// state is stored per-wallet without a network, so a mainnet name would
// otherwise conjure a Spending wallet on mutinynet nobody set up.