diff options
| author | Adam Soltys <[email protected]> | 2026-03-12 17:09:01 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-03-13 15:14:51 -0700 |
| commit | d3ee2bbc3baa33140f18a95c3e4b78a797330ad0 (patch) | |
| tree | 53692c72057f824628cc740f5766f8169b169be5 /lib/ark.ts | |
| parent | 6cdb3175ec10fcf27efea6d4ed076af33f19d3ac (diff) | |
| download | coinos-server-d3ee2bbc3baa33140f18a95c3e4b78a797330ad0.tar.gz coinos-server-d3ee2bbc3baa33140f18a95c3e4b78a797330ad0.zip | |
ark fixes
Diffstat (limited to 'lib/ark.ts')
| -rw-r--r-- | lib/ark.ts | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -28,7 +28,13 @@ const getWallet = async () => { let refreshing = false; let lastRefresh = 0; const REFRESH_COOLDOWN = 30_000; -const failedBoardingOutpoints = new Set<string>(); +let failedBoardingOutpoints = new Set<string>(); +const FAILED_BOARDING_KEY = "ark:failedBoardingOutpoints"; +const loadFailedOutpoints = async () => { + const members = await db.sMembers(FAILED_BOARDING_KEY); + failedBoardingOutpoints = new Set(members); +}; +loadFailedOutpoints(); let recoveryFailures = 0; let renewalFailures = 0; @@ -147,10 +153,14 @@ export const refreshArkWallet = async (force = false) => { l("ark onboarded boarding utxo:", utxo.value, "sats, txid:", txid); await logArkOp("onboard", { txid, amount: utxo.value, boardingTxid: utxo.txid, vout: utxo.vout }); failedBoardingOutpoints.clear(); + await db.del(FAILED_BOARDING_KEY); break; } catch (e: any) { const retriable = /not enough intent confirmations|timed out|signing_session/i.test(e.message); - if (!retriable) failedBoardingOutpoints.add(outpointKey(utxo)); + if (!retriable) { + failedBoardingOutpoints.add(outpointKey(utxo)); + await db.sAdd(FAILED_BOARDING_KEY, outpointKey(utxo)); + } warn("ark onboard failed:", utxo.value, "sats:", e.message); } } |
