// and we are blocksLeft behind out of (target-1) total blocks (since block 0 is genesis)
double approximateSizeMB = 0.0;
if (target > 1) {
- approximateSizeMB = (blocksLeft * 500.0) / (target - 1);
- }
- QString sizeText;
- if (approximateSizeMB < 1) {
- sizeText = QString("%1 KB").arg(QString::number(approximateSizeMB * 1024, 'f', 0));
- } else {
- sizeText = QString("%1 MB").arg(QString::number(approximateSizeMB, 'f', 1));
+ quint64 estimatedBytes = Utils::estimateSyncDataSize(blocksLeft);
+ sizeText = Utils::formatBytes(estimatedBytes);
}
QString statusMsg = Utils::formatSyncStatus(height, target, daemonSync);
// Shows "# blocks remaining (approx. X MB)" to sync
}
quint64 estimateSyncDataSize(quint64 blocks) {
- // Estimate 1024 bytes per block (1KB) for wallet scanning.
- return blocks * 1024;
+ // Estimate 30KB per block for wallet scanning.
+ return blocks * 30 * 1024;
}
QString formatPausedSyncStatus(quint64 blocks) {
if (tooltip) {
*tooltip = QString("Wallet Height: %1 | Network Tip: %2").arg(walletHeight).arg(daemonHeight);
}
- quint64 blocksBehind = (daemonHeight > startHeight) ? (daemonHeight - startHeight) : 0;
+ if (blocksBehind == 0) {
+ return "[PAUSED] Sync paused";
+ }
return formatPausedSyncStatus(blocksBehind);
}