diff options
| author | Adam Soltys <[email protected]> | 2026-08-14 00:44:28 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-08-14 00:44:28 -0700 |
| commit | 9bca1d54f66d5ed553694cd96d1f5b1cacdf5ae7 (patch) | |
| tree | 601cefbd4c5f37dfa2960e48cbaef77aae98619b /names/server.js | |
| parent | c61f8775b724b079b25d01964ece7dd3064845fe (diff) | |
| download | coinosv3-server-9bca1d54f66d5ed553694cd96d1f5b1cacdf5ae7.tar.gz coinosv3-server-9bca1d54f66d5ed553694cd96d1f5b1cacdf5ae7.zip | |
Sub-sat routes round back up: a zero quote just fails its first attempt and pays 1 sat on retry anyway — true free needs the ASP to bring the msats
Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014tE4U5nEjGTQy8PwYqamfv
Diffstat (limited to 'names/server.js')
| -rw-r--r-- | names/server.js | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/names/server.js b/names/server.js index 976fe60..2bfab2a 100644 --- a/names/server.js +++ b/names/server.js @@ -210,11 +210,13 @@ const ln = CFG.ln ? lnBackend(CFG.ln) : null; // -- routing-fee quotes (the /lnquote endpoint) ------------------------------ -// Sub-sat route fees round DOWN to a free quote: Ark locks are sat-granular, -// and captaind passes a 0 maxfee as an absent proto field, so xpay falls back -// to its default ~1% cap and the ASP absorbs the msats (which land on our own -// node whenever the route goes through it). Anything >= 1 sat rounds up. -const quoteSat = (msat) => (msat < 1000 ? 0 : Math.ceil(msat / 1000)); +// Ark locks are sat-granular and the locked surplus IS xpay's maxfee, which +// binds hard — a 9 msat route under a 0 budget fails outright (verified live: +// "Could not find route without excessive cost", then the +1-sat retry paid). +// So sub-sat fees round UP: the honest minimum a client can bring is 1 sat. +// Making those truly free needs the ASP to bring the msats itself (captaind +// patch: floor max_routing_fee at 1 sat), not a rounder-down here. +const quoteSat = (msat) => Math.ceil(msat / 1000); let _ourNodeId = null; async function ourNodeId() { |
