diff --git a/src/gridcoin/scraper/scraper.cpp b/src/gridcoin/scraper/scraper.cpp index 6df1f933d8..164911551c 100755 --- a/src/gridcoin/scraper/scraper.cpp +++ b/src/gridcoin/scraper/scraper.cpp @@ -3937,8 +3937,6 @@ ScraperStatsVerifiedBeaconsTotalCredits GetScraperStatsByConvergedManifest(const // Enumerate the count of active projects from the dummy converged manifest. One of the parts // is the beacon list, is not a project, which is why that should not be included in the count. // Populate the verified beacons map, and if it is don't count that either. - ScraperPendingBeaconMap VerifiedBeaconMap; - int exclude_parts_from_count = 1; auto iter = StructConvergedManifest.ConvergedManifestPartPtrsMap.find("VerifiedBeacons"); @@ -3948,7 +3946,7 @@ ScraperStatsVerifiedBeaconsTotalCredits GetScraperStatsByConvergedManifest(const try { - part >> VerifiedBeaconMap; + part >> stats_verified_beacons_tc.mVerifiedMap; } catch (const std::exception& e) { @@ -3958,10 +3956,6 @@ ScraperStatsVerifiedBeaconsTotalCredits GetScraperStatsByConvergedManifest(const ++exclude_parts_from_count; } - stats_verified_beacons_tc.mVerifiedMap = VerifiedBeaconMap; - - std::map projects_all_cpid_total_credits_map; - iter = StructConvergedManifest.ConvergedManifestPartPtrsMap.find("ProjectsAllCpidTotalCredits"); if (iter != StructConvergedManifest.ConvergedManifestPartPtrsMap.end()) { @@ -3969,7 +3963,7 @@ ScraperStatsVerifiedBeaconsTotalCredits GetScraperStatsByConvergedManifest(const try { - part >> projects_all_cpid_total_credits_map; + part >> stats_verified_beacons_tc.m_total_credit_map; } catch (const std::exception& e) { @@ -3979,8 +3973,6 @@ ScraperStatsVerifiedBeaconsTotalCredits GetScraperStatsByConvergedManifest(const ++exclude_parts_from_count; } - stats_verified_beacons_tc.m_total_credit_map = projects_all_cpid_total_credits_map; - unsigned int nActiveProjects = StructConvergedManifest.ConvergedManifestPartPtrsMap.size() - exclude_parts_from_count; // If a project part is greylisted, do not count it as an active project, even though stats have been collected. @@ -4660,6 +4652,14 @@ EXCLUSIVE_LOCKS_REQUIRED(cs_StructScraperFileManifest, CScraperManifest::cs_mapM auto scraper_cmanifest_include_noncurrent_proj_files = []() { LOCK(cs_ScraperGlobals); return SCRAPER_CMANIFEST_INCLUDE_NONCURRENT_PROJ_FILES; }; + // Populate the all cpid total credit map from current entries only. Keep track of the timestamps and assign + // the latest manifest file entry timestamp to the total_credit_map_timestamp. + if (entry.second.current && !entry.second.excludefromcsmanifest) { + total_credit_map.insert(std::make_pair(entry.first, entry.second.all_cpid_total_credit)); + + total_credit_map_timestamp = std::max(entry.second.timestamp, total_credit_map_timestamp); + } + // If SCRAPER_CMANIFEST_INCLUDE_NONCURRENT_PROJ_FILES is false, only include current files to send across the // network. Also continue (exclude) if it is a non-publishable entry (excludefromcsmanifest is true) or // if it has no records. @@ -4668,14 +4668,6 @@ EXCLUSIVE_LOCKS_REQUIRED(cs_StructScraperFileManifest, CScraperManifest::cs_mapM continue; } - // Populate the all cpid total credit map from current entries only. Keep track of the timestamps and assign - // the latest manifest file entry timestamp to the total_credit_map_timestamp. - if (entry.second.current) { - total_credit_map.insert(std::make_pair(entry.first, entry.second.all_cpid_total_credit)); - - total_credit_map_timestamp = std::max(entry.second.timestamp, total_credit_map_timestamp); - } - fs::path inputfile = entry.first; fs::path inputfilewpath = pathScraper / inputfile; diff --git a/src/gridcoin/scraper/scraper_net.cpp b/src/gridcoin/scraper/scraper_net.cpp index 99d402e2ab..234d827f2d 100644 --- a/src/gridcoin/scraper/scraper_net.cpp +++ b/src/gridcoin/scraper/scraper_net.cpp @@ -881,10 +881,8 @@ UniValue CScraperManifest::ToJson() const EXCLUSIVE_LOCKS_REQUIRED(CSplitBlob::c if (part.project != "ProjectsAllCpidTotalCredits") { projects.push_back(part.ToJson()); - } else { - CDataStream ss(SER_NETWORK, 1); - - ss << vParts[part.part1]->data; + } else if (!vParts[part.part1]->data.empty()) { + CDataStream ss(vParts[part.part1]->data, SER_NETWORK, 1); ss >> total_credit_map;