aboutsummaryrefslogtreecommitdiffstats
path: root/src/nwc-respond.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-10-30 15:57:46 -0700
committerAdam Soltys <[email protected]>2026-10-30 15:57:46 -0700
commitfd60875c2233ad4e367a501825f5e3e37bb2dec6 (patch)
treef83532e66b4e1e230709e908a79aa6e046838238 /src/nwc-respond.js
parent5ee7b8ffbb57ca800a145c1ff8ede3aeff5b0dc6 (diff)
downloadcoinosv3-fd60875c2233ad4e367a501825f5e3e37bb2dec6.tar.gz
coinosv3-fd60875c2233ad4e367a501825f5e3e37bb2dec6.zip
A wallet that renews its own coins (Settings → Spending: self or exit) pays a Lightning invoice from the coins nearest expiry first, so fewer of them come up for a paid renewal (Stacker News request, 2026-10-29). Lightning sends only: the ASP takes those coins, whereas an Ark-to-Ark send would hand the recipient your short timelocks. The custodial default keeps the smallest coin that covers the payment (expiry costs nothing there), a coin past its timelock still goes last, and a pile of old crumbs that would breach the input cap falls back to largest-first. The closed-app NWC worker follows the mirrored tier the same way
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VMan6VLgQdujavxPsfU7A9
Diffstat (limited to 'src/nwc-respond.js')
-rw-r--r--src/nwc-respond.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/nwc-respond.js b/src/nwc-respond.js
index 04340d0..12101f5 100644
--- a/src/nwc-respond.js
+++ b/src/nwc-respond.js
@@ -91,6 +91,7 @@ export async function bgManager(rec, walletKey, saveFn, log = null) {
account: shimAccount(rec), storage,
arkUrl: rec.ark.arkUrl, esploraUrl: rec.ark.esploraUrl, network: rec.ark.network,
honorsExpired: !!rec.ark.honorsExpired,
+ lnOldestFirst: () => !!rec.custody && rec.custody !== 'custodial',
}).init();
}