From 291e03eb15a97fdaaa18537cc4a811b6e6004a8f Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sat, 27 Jun 2026 08:40:26 -0700 Subject: Refresh tx confirmations on poll so non-WS backends don't show stale pending MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The light frontier poll walks past already-used addresses, and _reconcileHeld refreshed held-coin balances but not the history tx summaries — so a pending->confirmed transition only showed via the realtime WebSocket push. Backends without that push (custom electrs/esplora, regtest) left the History row stuck on "pending" even after the tx confirmed. Re-fetch and update tx summaries for changed held addresses during reconcile. Co-Authored-By: Claude Opus 4.8 --- src/wallet.js | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src') diff --git a/src/wallet.js b/src/wallet.js index b0cd963..33a1f3f 100644 --- a/src/wallet.js +++ b/src/wallet.js @@ -494,6 +494,17 @@ export class Wallet { this.utxos.push({ txid: u.txid, vout: u.vout, value: u.value, address, chain: p.chain, index: p.index, confirmed: conf }); } if (entry) { entry.confirmed = eConf; entry.pending = ePend; } + // Also refresh this address's tx history so a pending→confirmed transition + // shows in History on the next poll — not only via the realtime push, + // which regtest / custom-explorer (non-WS) backends don't have. + try { + const list = await this.api.addressTxs(address); + for (const tx of list) { + const summary = this._txSummary(tx); + const at = this.txs.findIndex((t) => t.txid === tx.txid); + if (at >= 0) this.txs[at] = summary; else this.txs.push(summary); + } + } catch {} changed = true; } return changed; -- cgit v1.2.3