From 75423a5ce3873f8630faf20baafba64d2f579164 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sun, 1 Mar 2026 22:29:00 -0800 Subject: log ark wallet balance --- lib/ark.ts | 18 ++++++++++++++++++ routes/payments.ts | 7 ++----- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/lib/ark.ts b/lib/ark.ts index 23824a62..342b3dd6 100644 --- a/lib/ark.ts +++ b/lib/ark.ts @@ -110,6 +110,24 @@ export const refreshArkWallet = async (force = false) => { // Initial check after 30s startup delay; ongoing checks triggered by ZMQ blocks setTimeout(refreshArkWallet, 30_000); +// Log ark wallet balances every 60s +setInterval(async () => { + try { + const w = await getWallet(); + const balance = await w.getBalance(); + l( + "ark balance — available:", + balance.available, + "recoverable:", + balance.recoverable, + "boarding:", + balance.boarding.confirmed, + ); + } catch (e: any) { + warn("ark balance check failed:", e.message); + } +}, 60_000); + export const sendArk = async (address: string, amount: number) => { const timeout = new Promise((_, reject) => setTimeout(() => reject(new Error("Ark send timed out")), 60000), diff --git a/routes/payments.ts b/routes/payments.ts index beae4d1a..91115fc2 100644 --- a/routes/payments.ts +++ b/routes/payments.ts @@ -946,7 +946,7 @@ export default { const body = await c.req.json(); const { transactions = [], aid } = body; const { id: uid } = user; - l("arkSync", user.username, aid, "txs:", transactions.length, "bal:", body.balance); + // verbose arkSync logging removed to reduce noise const lockKey = `arksynclock:${aid}`; const gotLock = await db.set(lockKey, "1", { NX: true, EX: 30 }); @@ -961,7 +961,7 @@ export default { account.arkAddress = body.arkAddress; await s(`account:${aid}`, account); await db.set(`arkaddr:${body.arkAddress}`, JSON.stringify({ aid, uid })); - l("arkSync updated arkAddress for", aid); + // arkSync updated arkAddress silently } } @@ -1063,10 +1063,8 @@ export default { let forward; if (received > 0) { const account = await g(`account:${aid}`); - l("arkSync forward check", aid, account?.arkAddress, received); if (account?.arkAddress) { const iid = await g(`custodial-ark-invoice:${account.arkAddress}`); - l("arkSync custodial invoice lookup", account.arkAddress, iid); if (iid) { const inv = await getInvoice(iid); if (inv && (inv.received < inv.amount || inv.amount === 0)) { @@ -1076,7 +1074,6 @@ export default { amount: inv.amount || received, serverArkAddress, }; - l("arkSync returning forward", forward); } } } -- cgit v1.2.3