From 7045711d9d6a639d0180a049fe0fd7ad61a2fcf3 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Mon, 17 Aug 2026 19:30:05 -0700 Subject: 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 Claude-Session: https://claude.ai/code/session_01JtaatFfAbx91Nh3xqKVqKz --- src/app.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src') 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. -- cgit v1.2.3