@@ -4704,14 +4704,6 @@ bool ScraperConstructConvergedManifestByProject(const NN::WhitelistSnapshot& pro
4704
4704
_log (logattribute::INFO, " ENDLOCK" , " CSplitBlob::cs_mapParts" );
4705
4705
}
4706
4706
4707
- /*
4708
-
4709
- // The ConvergedManifest content hash is in the order of the map key and on the data.
4710
- for (const auto& iter : StructConvergedManifest.ConvergedManifestPartPtrsMap)
4711
- ss << iter.second->data;
4712
-
4713
- StructConvergedManifest.nContentHash = Hash(ss.begin(), ss.end());
4714
- */
4715
4707
StructConvergedManifest.ComputeConvergedContentHash ();
4716
4708
4717
4709
StructConvergedManifest.timestamp = GetAdjustedTime ();
@@ -4809,6 +4801,9 @@ mmCSManifestsBinnedByScraper BinCScraperManifestsByScraper()
4809
4801
{
4810
4802
CScraperManifest& manifest = *iter->second ;
4811
4803
4804
+ // Do not consider manifests that do not have all of their parts.
4805
+ if (!manifest.isComplete ()) continue ;
4806
+
4812
4807
std::string sManifestName = manifest.sCManifestName ;
4813
4808
int64_t nTime = manifest.nTime ;
4814
4809
uint256 nHash = *manifest.phash ;
@@ -4843,7 +4838,7 @@ mmCSManifestsBinnedByScraper ScraperCullAndBinCScraperManifests()
4843
4838
4844
4839
_log (logattribute::INFO, " ScraperDeleteCScraperManifests" , " Deleting old CScraperManifests." );
4845
4840
4846
- LOCK2 (CScraperManifest::cs_mapManifest, CSplitBlob::cs_mapParts );
4841
+ LOCK (CScraperManifest::cs_mapManifest);
4847
4842
_log (logattribute::INFO, " LOCK" , " CScraperManifest::cs_mapManifest" );
4848
4843
4849
4844
// First check for unauthorized manifests just in case a scraper has been deauthorized.
@@ -4924,7 +4919,7 @@ mmCSManifestsBinnedByScraper ScraperCullAndBinCScraperManifests()
4924
4919
// that large. (The lock on CScraperManifest::cs_mapManifest is still held from above.)
4925
4920
mMapCSManifestsBinnedByScraper = BinCScraperManifestsByScraper ();
4926
4921
4927
- _log (logattribute::INFO, " ENDLOCK2 " , " CScraperManifest::cs_mapManifest, CSplitBlob::cs_mapParts " );
4922
+ _log (logattribute::INFO, " ENDLOCK " , " CScraperManifest::cs_mapManifest" );
4928
4923
4929
4924
return mMapCSManifestsBinnedByScraper ;
4930
4925
}
@@ -4934,29 +4929,21 @@ mmCSManifestsBinnedByScraper ScraperCullAndBinCScraperManifests()
4934
4929
// ---------------------------------------------- In ---------------------------------------- Out
4935
4930
bool LoadBeaconListFromConvergedManifest (const ConvergedManifest& StructConvergedManifest, ScraperBeaconMap& mBeaconMap )
4936
4931
{
4937
- boostio::filtering_istream in;
4932
+ // Find the beacon list.
4933
+ auto iter = StructConvergedManifest.ConvergedManifestPartPtrsMap .find (" BeaconList" );
4938
4934
4935
+ // Bail if the beacon list is not found, or the part is zero size (missing referenced part)
4936
+ if (iter == StructConvergedManifest.ConvergedManifestPartPtrsMap .end () || iter->second ->data .size () == 0 )
4939
4937
{
4940
- LOCK (CSplitBlob::cs_mapParts);
4941
- _log (logattribute::INFO, " LOCK" , " CSplitBlob::cs_mapParts" );
4942
-
4943
- // Find the beacon list.
4944
- auto iter = StructConvergedManifest.ConvergedManifestPartPtrsMap .find (" BeaconList" );
4945
-
4946
- // Bail if the beacon list is not found, or the part is zero size (missing referenced part)
4947
- if (iter == StructConvergedManifest.ConvergedManifestPartPtrsMap .end () || iter->second ->data .size () == 0 )
4948
- {
4949
- return false ;
4950
- }
4951
-
4952
- boostio::basic_array_source<char > input_source (&iter->second ->data [0 ], iter->second ->data .size ());
4953
- boostio::stream<boostio::basic_array_source<char >> ingzss (input_source);
4938
+ return false ;
4939
+ }
4954
4940
4955
- in. push ( boostio::gzip_decompressor ());
4956
- in. push ( ingzss);
4941
+ boostio::basic_array_source< char > input_source (&iter-> second -> data [ 0 ], iter-> second -> data . size ());
4942
+ boostio::stream<boostio::basic_array_source< char >> ingzss (input_source );
4957
4943
4958
- _log (logattribute::INFO, " ENDLOCK" , " CSplitBlob::cs_mapParts" );
4959
- }
4944
+ boostio::filtering_istream in;
4945
+ in.push (boostio::gzip_decompressor ());
4946
+ in.push (ingzss);
4960
4947
4961
4948
std::string line;
4962
4949
0 commit comments