diff options
| author | Adam Soltys <[email protected]> | 2026-06-27 17:00:17 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-06-27 17:00:17 -0700 |
| commit | a52cf9e500847bc1d545eee9e2816a13cccf20cf (patch) | |
| tree | dd10eb3550dcc43f243a5973b88dbc74710de93b /src | |
| parent | e2aa10741a12329c1e5c28cd3887638e194ec3fc (diff) | |
| download | coinosv3-a52cf9e500847bc1d545eee9e2816a13cccf20cf.tar.gz coinosv3-a52cf9e500847bc1d545eee9e2816a13cccf20cf.zip | |
Fix SP balance not showing — fold SP into spendable/pendingIncoming getters
The header reads wallet.spendable (and pendingIncoming), which reduce over
this.utxos only; SP outputs live in this.spUtxos, so received SP value showed in
the Receive card but not the balance. Add confirmed SP to spendable and pending
SP to pendingIncoming.
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Diffstat (limited to 'src')
| -rw-r--r-- | src/wallet.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/wallet.js b/src/wallet.js index 3255048..45300c3 100644 --- a/src/wallet.js +++ b/src/wallet.js @@ -946,13 +946,14 @@ export class Wallet { if (res.has(utxoId(u))) return s; if (u.confirmed || u.chain === 1) return s + u.value; return s; - }, 0); + }, 0) + this.spBalance().confirmed; // confirmed silent-payment receipts are spendable } // Unconfirmed incoming receives (not our change, not gift-locked) — shown as a - // separate pending line, kept out of the spendable headline. + // separate pending line, kept out of the spendable headline. Includes pending + // (mempool) silent-payment receipts. get pendingIncoming() { const res = this.reservedSet(); - return this.utxos.reduce((s, u) => s + ((!u.confirmed && u.chain === 0 && !res.has(utxoId(u))) ? u.value : 0), 0); + return this.utxos.reduce((s, u) => s + ((!u.confirmed && u.chain === 0 && !res.has(utxoId(u))) ? u.value : 0), 0) + this.spBalance().pending; } _recomputeBalanceFromChains() { |
