diff options
| author | Adam Soltys <[email protected]> | 2026-08-09 21:32:44 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-08-09 21:32:44 -0700 |
| commit | 7eed458c9943c35e67a526ee3addb543dc0b9820 (patch) | |
| tree | 57edc98c215bf35271de99919d055c987345eb72 /names | |
| parent | 03fda2bc96a9bcaf2f864e5e80ad338948689c98 (diff) | |
| download | coinosv3-7eed458c9943c35e67a526ee3addb543dc0b9820.tar.gz coinosv3-7eed458c9943c35e67a526ee3addb543dc0b9820.zip | |
The float reads its mail: sync at startup and before each retry round, so a top-up is seen without a restart
Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01DbA53PJA8fgSvMcEzfuw22
Diffstat (limited to 'names')
| -rw-r--r-- | names/server.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/names/server.js b/names/server.js index 9931cae..3de2315 100644 --- a/names/server.js +++ b/names/server.js @@ -218,6 +218,9 @@ if (CFG.forwarder?.mnemonic) { }, arkUrl: CFG.forwarder.ark, esploraUrl: CFG.forwarder.esplora, network: CFG.forwarder.network || 'mainnet', }).init(); + // Read the mailbox before reporting: a top-up sent while we were down (or + // between syncs) lives there, and balance() only counts what state has seen. + await fwd.sync().catch(() => {}); log(`forwarder ark wallet ready — float ${fwd.balance().spendableSat} sat, receive ${fwd.address().slice(0, 24)}…`); } @@ -332,6 +335,9 @@ async function settleLoop() { setInterval(async () => { const q = state.pending || []; if (!q.length || !fwd) return; + // a float top-up arrives as ark mail; without this the queue would keep + // failing on a balance that's already been refilled + await fwd.sync().catch(() => {}); const still = []; for (const p of q) { if (p.next && Date.now() < p.next) { still.push(p); continue; } |
