diff options
| author | Adam Soltys <[email protected]> | 2026-10-03 16:00:39 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-10-03 16:00:39 -0700 |
| commit | 328f2db9af46cda473318bb3eada0f6e83bb42f1 (patch) | |
| tree | b4e850022ba260eff90940ebc465eebded023b63 /src/ark/manager.js | |
| parent | 141779ab97efad6abefaec0545bba5330fd1e12d (diff) | |
| download | coinosv3-328f2db9af46cda473318bb3eada0f6e83bb42f1.tar.gz coinosv3-328f2db9af46cda473318bb3eada0f6e83bb42f1.zip | |
A Lightning payment that can't be covered says why, not 'Payment failed'
A user renewed all ten of their coins (55,611 sats) from the coins page,
tried to pay a 55,300-sat invoice three minutes later, and was told only
'Payment failed'. Nothing had failed: the renewal's round ran at once,
but its coins stay unspendable until the round's transaction confirms
on-chain, and that block took 64 minutes. The quote found no spendable
coin and gave up with the generic message; nothing reached the server.
- The quote now tells apart (lnShortfall): money held by another payment
(wait, as before — now by sum, not one coin covering it all), money a
renewal holds ('Nothing was sent. N sats are being renewed…'), and a
real shortfall ('needs X sats with its fee, Y available'). Coins leaving
in an offboard or exit are never waited for.
- The manager's 'insufficient ark balance' names a renewal too.
- The coins page says before the tap that renewed coins can't be spent
until the round confirms, and that renewing every coin leaves nothing
to pay with meanwhile.
tools/ark/ln-shortfall-test.js
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01ULQZS9MQa6iAsXnrJUD9Du
Diffstat (limited to 'src/ark/manager.js')
| -rw-r--r-- | src/ark/manager.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/ark/manager.js b/src/ark/manager.js index dc80ca3..a114702 100644 --- a/src/ark/manager.js +++ b/src/ark/manager.js @@ -33,6 +33,7 @@ import { requestLightningPayHtlcRevocation, startLightningReceive, checkLightningReceive, prepareLightningReceiveClaim, claimLightningReceive, cancelLightningReceive, lightningReceiveAttestation, + lnShortfall, } from './lightning.js'; import { boardFee, p2trAddress, buildBoard, requestBoardCosign, @@ -868,8 +869,11 @@ export class ArkManager { const expiredSat = this.state.vtxos .filter((v) => v.state === 'spendable' && this._expired(v, tip)) .reduce((n, v) => n + v.amountSat, 0); - return expiredSat - ? `insufficient ark balance (${expiredSat} sat expired and unusable)` + if (expiredSat) return `insufficient ark balance (${expiredSat} sat expired and unusable)`; + // coins a renewal took stay unspendable until its round confirms on-chain + const renewing = lnShortfall(this.state.vtxos, this.state.actions, Infinity).renewingSat; + return renewing + ? `insufficient ark balance (${renewing} sat are being renewed and can't be spent until the renewal confirms on-chain)` : 'insufficient ark balance'; } |
