Skip to content

Commit 4defcd9

Browse files
committed
Update snapshot URLs and add accrual directory
This updates the URLs to use a CDN and also adds the accrual directory to be deleted before snapshot installation. The snapshot file does not have to contain an accrual directory, in which case the wallet will rebuild the accrual directory from restart.
1 parent efc666e commit 4defcd9

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

src/gridcoin/scraper/http.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ std::string Http::GetLatestVersionResponse()
301301

302302
void Http::DownloadSnapshot()
303303
{
304-
std::string url = GetArg("-snapshoturl", "https://download.gridcoin.us/download/downloadstake/signed/snapshot.zip");
304+
std::string url = GetArg("-snapshoturl", "https://snapshot.gridcoin.us/snapshot.zip");
305305

306306
fs::path destination = GetDataDir() / "snapshot.zip";
307307

@@ -383,7 +383,7 @@ std::string Http::GetSnapshotSHA256()
383383
{
384384
std::string buffer;
385385
std::string header;
386-
std::string url = GetArg("-snapshotsha256url", "https://download.gridcoin.us/download/downloadstake/signed/snapshot.zip.sha256");
386+
std::string url = GetArg("-snapshotsha256url", "https://snapshot.gridcoin.us/snapshot.zip.sha256");
387387

388388
struct curl_slist* headers = NULL;
389389
headers = curl_slist_append(headers, "Accept: */*");

src/gridcoin/upgrade.cpp

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -361,14 +361,22 @@ bool Upgrade::CleanupBlockchainData()
361361
{
362362
if (fs::is_directory(Iter->path()))
363363
{
364-
size_t DirLoc = Iter->path().string().find("txleveldb");
365-
366-
if (DirLoc != std::string::npos)
367-
if (!fs::remove_all(*Iter))
368-
return false;
364+
for (const auto& path_segment : Iter->path())
365+
{
366+
if (path_segment.string() == "txleveldb")
367+
{
368+
if (!fs::remove_all(*Iter)) return false;
369+
}
370+
}
369371

372+
for (const auto& path_segment : Iter->path())
373+
{
374+
if (path_segment.string() == "accrual")
375+
{
376+
if (!fs::remove_all(*Iter)) return false;
377+
}
378+
}
370379
continue;
371-
372380
}
373381

374382
else if (fs::is_regular_file(*Iter))

0 commit comments

Comments
 (0)