diff options
| author | Adam Soltys <[email protected]> | 2026-08-02 09:04:52 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-08-02 09:04:52 -0700 |
| commit | 468932b1c3a70bc384bf9d123bf681cb2e7ce0d2 (patch) | |
| tree | 3db064a19770d78228bbb1cdc0b5079a278fb776 /src/features/names.js | |
| parent | a60f2a090b12f62649ddd55d1a8605e433d2c75a (diff) | |
| download | coinosv3-468932b1c3a70bc384bf9d123bf681cb2e7ce0d2.tar.gz coinosv3-468932b1c3a70bc384bf9d123bf681cb2e7ce0d2.zip | |
Deliver incoming Lightning without depending on an operator float
A payment to an address settled on our node and then sat in a retry
queue because the float wallet that forwards it was empty — the money
was safe but invisible to the recipient. Delivery now has a second
route: ask the recipient's wallet for an invoice (CLINK) and pay it
over Lightning, which needs no float at all. The float path stays first
because it works while they're offline; the queue is now the last
resort rather than the only one.
Existing addresses never carried the wallet's offer key, so that route
was unavailable to them. The wallet now records what it published and
re-registers whenever the registrar is missing the current key.
Co-Authored-By: Claude Fable 5 <[email protected]>
Diffstat (limited to 'src/features/names.js')
| -rw-r--r-- | src/features/names.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/features/names.js b/src/features/names.js index 4c0ffaf..54f15f7 100644 --- a/src/features/names.js +++ b/src/features/names.js @@ -74,7 +74,7 @@ export function namesFeature(ctx) { ...(manager ? { manager } : {}), }, signer); const prev = load().name; - save({ name, domain: DOMAIN, uri, updated: Date.now() }); + save({ name, domain: DOMAIN, uri, offerPk: hook('nwcOfferPubkey') || null, updated: Date.now() }); if (prev && prev !== name) { post('/register', 'DELETE', { name: prev, domain: DOMAIN }).catch(() => {}); } @@ -147,7 +147,12 @@ export function namesFeature(ctx) { render(); if (!st.name) return; const uri = await currentUri(); - if (uri && uri !== st.uri) await claim(st.name); + // Re-publish when the address changed OR when the registrar doesn't yet + // know this wallet's offer key — that key is what lets an incoming + // Lightning payment be delivered straight to us instead of waiting on + // the operator's float. + const offerPk = hook('nwcOfferPubkey') || null; + if (uri && (uri !== st.uri || (offerPk && st.offerPk !== offerPk))) await claim(st.name); } catch (e) { console.warn('names: refresh failed —', e.message); lastError = e.message; |
