From 7041fa7aee6c7cb2f3a04ac06a180e2cb5dc7336 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Mon, 6 Jul 2026 10:30:27 -0700 Subject: Publish ark state on connect so idle devices share their balance MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cross-device ark sync only re-published on a state change (send/board), so a device holding ark funds but making no transaction never wrote its state to the relay — another device could never see those coins (and a legacy shared-tag snapshot that got clobbered to zero-ark stayed that way). connectArk now calls saveCache once on connect when there are vtxos, publishing this device's balance to its per-device slot so every device's ark funds reach the relay and get merged, no transaction needed. Co-Authored-By: Claude Fable 5 --- src/features/ark.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/features/ark.js b/src/features/ark.js index ba509aa..bf7b94f 100644 --- a/src/features/ark.js +++ b/src/features/ark.js @@ -177,6 +177,12 @@ export function arkFeature(ctx) { ark = mgr; announceArkAddress(mgr); // ark zaps: tell nostr where our mailbox lives startNwcFunding(mgr); // NWC bridge: honor funding requests within the allowance + // Publish this device's ark state to its per-device sync slot on connect. + // Cross-device sync only re-published on a state CHANGE (a send/board), so + // an idle device never shared its coins — another device would never see + // them. Publishing on connect guarantees every device's ark balance + // reaches the relay (and gets merged) without needing a transaction first. + if (mgr.state && (mgr.state.vtxos || []).length) { try { wallet.saveCache(); } catch {} } const tick = () => mgr.sync().catch(() => {}).then(() => driveExits(mgr)).catch(() => {}); tick(); // Reconcile once on connect: a vtxo synced in from another device (or -- cgit v1.2.3