fix(BUG-20): ElectrumX shows index size instead of "Building..."

When ElectrumX is indexing and can't accept TCP connections, the UI
now shows the actual index size (e.g. "126.9 GB") in the Indexed
Height field instead of a generic "Building..." label. Also shows
the size in the status message for better progress visibility.

Updated estimated full index size from 55GB to 130GB (2026 mainnet).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Dorian
2026-03-18 17:50:33 +00:00
parent 9f90c2cc91
commit f54206d231
2 changed files with 16 additions and 6 deletions

View File

@@ -367,11 +367,20 @@
var networkH = data.network_height || 0;
var pct = data.progress_pct || 0;
document.getElementById('indexedHeight').textContent = indexedH > 0 ? indexedH.toLocaleString() : (data.status === 'indexing' ? 'Building...' : '-');
// Show indexed height, or index size when still building
if (indexedH > 0) {
document.getElementById('indexedHeight').textContent = indexedH.toLocaleString();
document.getElementById('currentBlock').textContent = 'Block ' + indexedH.toLocaleString();
} else if (data.index_size) {
document.getElementById('indexedHeight').textContent = data.index_size;
document.getElementById('currentBlock').textContent = 'Index: ' + data.index_size;
} else {
document.getElementById('indexedHeight').textContent = '-';
document.getElementById('currentBlock').textContent = 'Block 0';
}
document.getElementById('networkHeight').textContent = networkH > 0 ? networkH.toLocaleString() : '-';
document.getElementById('indexSize').textContent = data.index_size || '-';
document.getElementById('progressPct').textContent = pct > 0 ? pct.toFixed(1) + '%' : '-';
document.getElementById('currentBlock').textContent = indexedH > 0 ? 'Block ' + indexedH.toLocaleString() : (data.index_size ? 'Index: ' + data.index_size : 'Block 0');
document.getElementById('syncPercentage').textContent = pct > 0 ? pct.toFixed(1) + '%' : '0%';
document.getElementById('syncProgressBar').style.width = Math.max(pct, 0.5) + '%';
@@ -380,12 +389,13 @@
var syncIcon = document.getElementById('syncIcon');
if (data.status === 'indexing') {
statusTextEl.textContent = data.error || 'Building index...';
var indexMsg = data.index_size ? 'Building index (' + data.index_size + ')...' : 'Building index...';
statusTextEl.textContent = indexMsg;
statusTextEl.style.color = '#fbbf24';
statusDot.className = 'status-dot bg-amber animate-pulse';
document.getElementById('statusText').textContent = 'Indexing';
syncIcon.classList.add('animate-spin-slow');
document.getElementById('connSubtitle').textContent = 'Connections will be available once ElectrumX has completed syncing.';
document.getElementById('connSubtitle').textContent = 'Wallet connections will be available once indexing completes. This can take several hours on first run.';
} else if (data.status === 'error') {
statusTextEl.textContent = data.error || 'Unknown error';
statusTextEl.style.color = '#f87171';