aboutsummaryrefslogtreecommitdiffstats
path: root/names
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-11-23 23:35:35 -0700
committerAdam Soltys <[email protected]>2026-11-23 23:35:35 -0700
commitbf092576d294d54a57bb18531b6bc6d84d0420b3 (patch)
tree2dd5fabe158135a54efe9de5bea2e8f1df3002c9 /names
parentca0581bd0ae0b923f312b6ecc1fd31ff7753d93b (diff)
downloadcoinosv3-server-bf092576d294d54a57bb18531b6bc6d84d0420b3.tar.gz
coinosv3-server-bf092576d294d54a57bb18531b6bc6d84d0420b3.zip
names: float consolidation skips a merge that can't pay for its round. Once upkeep ran again (f27c49c) the 92 small coins tripped consolidation, whose 64 smallest came to 259 sat against a 301-sat round fee: refused, and asked again every minute. Sends gather largest-first, so dust never decides whether one fits; the merge now waits until the coins it would take clear the fee and the 330-sat floor. Checked on the live float state (skip: true); names tests pass.
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VMan6Upic5L6MMJzkTn8zg
Diffstat (limited to 'names')
-rw-r--r--names/server.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/names/server.js b/names/server.js
index 6bbec01..600b12a 100644
--- a/names/server.js
+++ b/names/server.js
@@ -1035,9 +1035,13 @@ async function consolidateFloat() {
if ((fwd.state.actions || []).some((a) => !['done', 'failed'].includes(a.step))) return;
const small = (await smallCoins()).slice(0, CONSOLIDATE_MAX);
if (small.length < 2) return;
+ const sat = small.reduce((n, v) => n + v.amountSat, 0);
+ // a heap of dust can't pay for its own round (64 coins, 259 sat, 301 sat
+ // fee, 2026-11-24 — refused every minute once upkeep ran again); sends
+ // gather largest-first, so dust never decides whether one fits anyway
+ if (sat - fwd.refreshFee(small, await fwd.chain.tipHeight()) < 330) return;
consolidating = true;
try {
- const sat = small.reduce((n, v) => n + v.amountSat, 0);
log(`float consolidate: merging ${small.length} coins (${sat} sat)`);
await fwd.refresh(small.map((v) => v.id));
log(`float consolidate: submitted — it settles once the round confirms`);