diff options
| author | Adam Soltys <[email protected]> | 2026-03-01 22:29:00 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-03-01 22:29:00 -0800 |
| commit | 75423a5ce3873f8630faf20baafba64d2f579164 (patch) | |
| tree | c119b4c9b558faca5bf0086270125526b165d895 | |
| parent | 3bafa6c0f211a1aa8d223b9ad091016440947f2e (diff) | |
| download | coinos-server-75423a5ce3873f8630faf20baafba64d2f579164.tar.gz coinos-server-75423a5ce3873f8630faf20baafba64d2f579164.zip | |
log ark wallet balance
| -rw-r--r-- | lib/ark.ts | 18 | ||||
| -rw-r--r-- | routes/payments.ts | 7 |
2 files changed, 20 insertions, 5 deletions
@@ -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); } } } |
