fix(wallet): GUI bootstrap calls DownloadUtxoSnapshot, not legacy

The QT wallet's IntroDialog was calling Bootstrap::DownloadBootstrap(),
which always returns false ('Legacy file-list bootstrap is disabled').
Fresh wallet installs would show 'Could not download blockchain snapshot'
and fall back to slow genesis sync.

Fix: call DownloadUtxoSnapshot first (matches daemon init.cpp behavior),
fall back to legacy path for diagnostics. Also adds checkpoint + snapshot
hash for height 2,219,922 so the v6.2.5.0 snapshot can be verified by
fresh installs.
This commit is contained in:
Krystie
2026-08-03 17:57:31 -07:00
parent ecae3686a7
commit c0b8ede86b
2 changed files with 28 additions and 8 deletions
+12 -7
View File
@@ -52,6 +52,10 @@ namespace Checkpoints
{ 2213000, uint256("0x7bc9652d423676c52ba8b0a287e0b46e1eca6e8eecc51d3f30e0d665d3b236f5")},
{ 2214000, uint256("0x17e61ceb45db36358aaabe91b094a77ecba32370a467185fa9af75eef6c8e414")},
{ 2214400, uint256("0x8ebb818f7280850c5a3916b7c8a2bca603f7c4f9926d3cdc2262f726035d96ed")},
// Post-rebuild finality pin (v6.2.5.0). Closes the gap between
// the last hardcoded checkpoint and the live tip after -rebuildutxo.
// Hash from the canonical chain on DNS2 after fresh UTXO rebuild.
{ 2219922, uint256("0x9ed3e1d38317950927f37f2867e3fc29e239fc1f4c57b182f55c6e04b73b52ec")},
};
// Published UTXO snapshot file SHA256, keyed by snapshot height.
@@ -64,6 +68,7 @@ namespace Checkpoints
// mapCheckpoints / mapCheckpointsTestnet.
static std::map<int, uint256> mapSnapshotHashes = {
{ 2206004, uint256("0x1419282dae817315ee1b955543f6248233fe5800f5e8488734a0ece5bd6781ea")},
{ 2219922, uint256("0x6dd8d782a04bb8dc4ccd5e88a4bc7726fe26bdebaed96b79242de1e2949b6ee6")},
};
static std::map<int, uint256> mapSnapshotHashesTestnet = {
@@ -353,14 +358,14 @@ namespace Checkpoints
bool SetCheckpointPrivKey(std::string strPrivKey)
{
(void)strPrivKey;
return error("SetCheckpointPrivKey: synchronized checkpoints are disabled");
(void)strPrivKey;
return error("SetCheckpointPrivKey: synchronized checkpoints are disabled");
}
bool SendSyncCheckpoint(uint256 hashCheckpoint)
{
(void)hashCheckpoint;
return error("SendSyncCheckpoint: synchronized checkpoints are disabled");
(void)hashCheckpoint;
return error("SendSyncCheckpoint: synchronized checkpoints are disabled");
}
// Is the sync-checkpoint outside maturity window?
@@ -381,11 +386,11 @@ const std::string CSyncCheckpoint::strMasterPubKey = "";
std::string CSyncCheckpoint::strMasterPrivKey = "";
// triangles: verify signature of sync-checkpoint message
// The master-key system is disabled. Reject these legacy messages instead of
// treating unsigned data as authenticated if a dispatcher is added later.
// The master-key system is disabled. Reject these legacy messages instead of
// treating unsigned data as authenticated if a dispatcher is added later.
bool CSyncCheckpoint::CheckSignature()
{
return error("CSyncCheckpoint::CheckSignature: synchronized checkpoints are disabled");
return error("CSyncCheckpoint::CheckSignature: synchronized checkpoints are disabled");
}
// triangles: process synchronized checkpoint
+16 -1
View File
@@ -291,7 +291,22 @@ bool IntroDialog::pickDataDirectory()
QApplication::processEvents();
};
bool success = Bootstrap::DownloadBootstrap(host, dataDirPath, progressFn, strError);
// Try the fast UTXO snapshot path first (matches daemon behavior in init.cpp).
// The legacy DownloadBootstrap() is hard-disabled in bootstrap.cpp — it always
// returns false with "Legacy file-list bootstrap is disabled". Calling it here
// would make the GUI wallet unable to bootstrap a fresh install.
std::string utxoError;
bool success = Bootstrap::DownloadUtxoSnapshot(host, dataDirPath, progressFn, utxoError);
if (!success) {
// Fall back to legacy bootstrap path (will fail with "disabled" error, but
// surfaces the real error if the snapshot path had a different failure).
std::string legacyError;
if (Bootstrap::DownloadBootstrap(host, dataDirPath, progressFn, legacyError)) {
success = true;
} else {
strError = "UTXO snapshot: " + utxoError + " | Legacy: " + legacyError;
}
}
if (!success) {
QMessageBox::warning(0, "Triangles",
QString("Could not download blockchain snapshot:\n%1\n\n"