From 7eed458c9943c35e67a526ee3addb543dc0b9820 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sun, 9 Aug 2026 21:32:44 -0700 Subject: 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 Claude-Session: https://claude.ai/code/session_01DbA53PJA8fgSvMcEzfuw22 --- names/server.js | 6 ++++++ 1 file changed, 6 insertions(+) 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; } -- cgit v1.2.3