aboutsummaryrefslogtreecommitdiffstats
path: root/src/features
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-07-06 10:36:54 -0700
committerAdam Soltys <[email protected]>2026-07-06 10:36:54 -0700
commit9c4c828bfbf50db7dfa61f1b9ae4cc0ffc7cac5b (patch)
treed5a9935327f58b22da7723c0b2e8d6b2a54fb433 /src/features
parent7041fa7aee6c7cb2f3a04ac06a180e2cb5dc7336 (diff)
downloadcoinosv3-9c4c828bfbf50db7dfa61f1b9ae4cc0ffc7cac5b.tar.gz
coinosv3-9c4c828bfbf50db7dfa61f1b9ae4cc0ffc7cac5b.zip
tmp: instrument ark connect + sync publish (debug)
Diffstat (limited to 'src/features')
-rw-r--r--src/features/ark.js3
-rw-r--r--src/features/sync.js3
2 files changed, 4 insertions, 2 deletions
diff --git a/src/features/ark.js b/src/features/ark.js
index bf7b94f..d0f17f2 100644
--- a/src/features/ark.js
+++ b/src/features/ark.js
@@ -182,7 +182,8 @@ export function arkFeature(ctx) {
// 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 {} }
+ console.log('[arkdbg] connected, vtxos=', (mgr.state && mgr.state.vtxos || []).length, 'net=', getNetwork());
+ if (mgr.state && (mgr.state.vtxos || []).length) { try { wallet.saveCache(); console.log('[arkdbg] on-connect saveCache called'); } catch (e) { console.log('[arkdbg] saveCache threw', e.message); } }
const tick = () => mgr.sync().catch(() => {}).then(() => driveExits(mgr)).catch(() => {});
tick();
// Reconcile once on connect: a vtxo synced in from another device (or
diff --git a/src/features/sync.js b/src/features/sync.js
index 1f3414d..9d361aa 100644
--- a/src/features/sync.js
+++ b/src/features/sync.js
@@ -111,8 +111,9 @@ export function installSyncWallet(wallet) {
// bind the per-device d-tag now: the debounced publish must keep this
// snapshot's network even if the wallet switches networks before it fires
const dtag = deviceDtag(wallet.netName);
+ console.log('[syncdbg] cacheSaved scheduling publish', dtag, 'hasArk?', !!snap.arkState, 'sk?', !!wallet.nostr.sk);
clearTimeout(wallet._nostrPubTimer);
- wallet._nostrPubTimer = setTimeout(() => wallet.nostr.publish(snap, dtag), 2500);
+ wallet._nostrPubTimer = setTimeout(() => { console.log('[syncdbg] publishing now', dtag); wallet.nostr.publish(snap, dtag); }, 2500);
});
wallet.registerRealtimeHook({ stop: () => clearTimeout(wallet._nostrPubTimer) });
}