aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-03-01 22:29:00 -0800
committerAdam Soltys <[email protected]>2026-03-01 22:29:00 -0800
commit75423a5ce3873f8630faf20baafba64d2f579164 (patch)
treec119b4c9b558faca5bf0086270125526b165d895
parent3bafa6c0f211a1aa8d223b9ad091016440947f2e (diff)
downloadcoinos-server-75423a5ce3873f8630faf20baafba64d2f579164.tar.gz
coinos-server-75423a5ce3873f8630faf20baafba64d2f579164.zip
log ark wallet balance
-rw-r--r--lib/ark.ts18
-rw-r--r--routes/payments.ts7
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);
}
}
}