diff options
| author | Adam Soltys <[email protected]> | 2026-03-17 01:34:24 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-03-17 01:34:28 -0700 |
| commit | ab47682bf20e79931bdb3a4b65196c41c1c81275 (patch) | |
| tree | eb10ade24273b653e71bc9c9093995cf2412c18f /lib | |
| parent | 136ba2a12e87178f6d83fba2874abf4c9ad32915 (diff) | |
| download | coinos-server-ab47682bf20e79931bdb3a4b65196c41c1c81275.tar.gz coinos-server-ab47682bf20e79931bdb3a4b65196c41c1c81275.zip | |
handle ark dust
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/ark.ts | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -67,7 +67,7 @@ export const refreshArkWallet = async (force = false) => { const w = await getWallet(); const balance = await w.getBalance(); cachedArkBalance = balance; - const manager = new VtxoManager(w); + const manager = new VtxoManager(w, undefined, false); const provider = new RestArkProvider(config.ark.arkServerUrl); const info = await provider.getInfo(); const dust = Number(info.dust); @@ -114,7 +114,8 @@ export const refreshArkWallet = async (force = false) => { try { const allExpiring = await manager.getExpiringVtxos(RENEWAL_THRESHOLD_MS); const expiring = allExpiring.filter((v: any) => v.value > Number(info.dust)); - if (expiring.length > 0) { + const allTotal = allExpiring.reduce((s: number, v: any) => s + v.value, 0); + if (expiring.length > 0 && allTotal > dust) { const expiringTotal = expiring.reduce((s: number, v: any) => s + v.value, 0); l("ark renewing", expiring.length, "expiring vtxos, total:", expiringTotal, "sats (skipped", allExpiring.length - expiring.length, "dust)"); const txid = await withTimeout(manager.renewVtxos(), 60_000, "ark renewal"); |
