aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-06-14 12:42:59 -0700
committerAdam Soltys <[email protected]>2026-06-17 07:47:49 -0700
commitb83d5dfc6dc27b7af1fbc723b61e017fd9caf7d7 (patch)
treeeada7a9a792f51cd5224ccd8759af5d6a878be18 /scripts
parentceb003afb154560bb68b4252759fedc1fee75a0f (diff)
downloadcoinos-server-b83d5dfc6dc27b7af1fbc723b61e017fd9caf7d7.tar.gz
coinos-server-b83d5dfc6dc27b7af1fbc723b61e017fd9caf7d7.zip
nwc: fix pay_invoice reply reliability, rate-limit drops, always reply
Port of master 8cb18821 (refs #80), adapted to staging's nwc event loop. (a) pay_invoice: sendLightning runs xpay to completion and finalize() sets p.ref = preimage, so return that directly instead of polling listpays and racing a 20s timeout that returned a misleading "Payment timed out" even when the payment settled. Keep a longer listpays loop as a fallback; on still-in-flight return an explicit "check with lookup_invoice". (b) rate limiting: raised per-pubkey cap 5 -> 60/min, and over-limit requests now get a NIP-47 RATE_LIMITED reply instead of a silent drop that looked like a lost reply. Every request path now always sends a 23195 reply (success, error, or handler-returned-nothing) so a client never hangs. Pulled the reply/encrypt logic into a reply() helper. The notify default-on part of 8cb18821 is intentionally NOT ported: master 10284aa1 reverted it to opt-in, which is already staging's behavior (notify = String(notify) === "true"). Co-Authored-By: Claude Opus 4.8 <[email protected]>
Diffstat (limited to 'scripts')
0 files changed, 0 insertions, 0 deletions