aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-06-27 08:40:26 -0700
committerAdam Soltys <[email protected]>2026-06-27 08:40:26 -0700
commit291e03eb15a97fdaaa18537cc4a811b6e6004a8f (patch)
tree8151d17d88e164e63b56c9d22c439b38c198b4fc /src
parent9ce15c044ce095eea19fc0b48d229d3b78c58348 (diff)
downloadcoinosv3-291e03eb15a97fdaaa18537cc4a811b6e6004a8f.tar.gz
coinosv3-291e03eb15a97fdaaa18537cc4a811b6e6004a8f.zip
Refresh tx confirmations on poll so non-WS backends don't show stale pending
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 <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/wallet.js11
1 files changed, 11 insertions, 0 deletions
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;