aboutsummaryrefslogtreecommitdiffstats
path: root/src/app.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-08-17 15:22:11 -0700
committerAdam Soltys <[email protected]>2026-08-17 15:22:11 -0700
commitde727b751c9242eedd41d0ea85299b6e496a6a4c (patch)
treefba844f00bb908c2c82cbcda6cb09492329a9951 /src/app.js
parent00a0be5fcd8157f145c63df44982b4f74960c815 (diff)
downloadcoinosv3-de727b751c9242eedd41d0ea85299b6e496a6a4c.tar.gz
coinosv3-de727b751c9242eedd41d0ea85299b6e496a6a4c.zip
A mainnet name stops vouching for mutinynet spending: the claimed-address evidence only counts on the network it was claimed on
Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01JtaatFfAbx91Nh3xqKVqKz
Diffstat (limited to 'src/app.js')
-rw-r--r--src/app.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/app.js b/src/app.js
index c9ba70a..5d3b049 100644
--- a/src/app.js
+++ b/src/app.js
@@ -2867,7 +2867,9 @@ function onboardScreen() {
// network without names, or skipping the spend step, must not conjure
// a Spending wallet nobody asked for.
const acc = activeAccount();
- const addr = featureHook('namesAddress');
+ // same mainnet-only rule as spendingActive: a stored mainnet name must
+ // not vouch for spending on another network
+ const addr = getNetwork() === 'mainnet' ? featureHook('namesAddress') : null;
const spendReady = (!!addr && !/^npub1/.test(addr)) || (featureHook('spendingSat') || 0) > 0;
if (spendReady) {
if (acc && !acc.spendingSetup) { acc.spendingSetup = true; persistAccounts(); }
@@ -2989,7 +2991,10 @@ function spendingActive() {
if (!featureHook('arkReady')) return false;
const acc = activeAccount();
if (acc?.spendingSetup) return true;
- const addr = featureHook('namesAddress');
+ // 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.
+ const addr = getNetwork() === 'mainnet' ? featureHook('namesAddress') : null;
const evident = (featureHook('spendingSat') || 0) > 0 || (!!addr && !/^npub1/.test(addr));
// Latch demonstrated use onto the record, so the Wallets list keeps showing
// this seed's Spending side even while it's locked or not the active one.