@@ -149,7 +149,6 @@ int64_t nLastPing = 0;
149149int64_t nLastAskedForBlocks = 0 ;
150150int64_t nBootup = 0 ;
151151int64_t nLastLoadAdminMessages = 0 ;
152- int64_t nCPIDsLoaded = 0 ;
153152int64_t nLastGRCtallied = 0 ;
154153int64_t nLastCleaned = 0 ;
155154
@@ -262,7 +261,6 @@ bool bGridcoinGUILoaded = false;
262261extern double LederstrumpfMagnitude2 (double Magnitude, int64_t locktime);
263262
264263extern void WriteAppCache (std::string key, std::string value);
265- extern void LoadCPIDsInBackground ();
266264
267265extern void ThreadCPIDs ();
268266extern void GetGlobalStatus ();
@@ -649,14 +647,13 @@ MiningCPID GetNextProject(bool bForce)
649647
650648
651649
652- if ( ( IsInitialBlockDownload () || !bCPIDsLoaded ) && !bForce)
650+ if (IsInitialBlockDownload () && !bForce)
653651 {
654- if (LessVerbose (100 )) printf (" CPUMiner: Gridcoin is downloading blocks Or CPIDs are not yet loaded..." );
655- MilliSleep (1 );
656- return GlobalCPUMiningCPID;
652+ if (LessVerbose (100 )) printf (" CPUMiner: Gridcoin is downloading blocks Or CPIDs are not yet loaded..." );
653+ MilliSleep (1 );
654+ return GlobalCPUMiningCPID;
657655 }
658656
659-
660657 try
661658 {
662659
@@ -7715,33 +7712,15 @@ void HarvestCPIDs(bool cleardata)
77157712 {
77167713 printf (" Error while harvesting CPIDs 2.\r\n " );
77177714 }
7718-
7719-
7720-
77217715}
77227716
7723-
7724-
7725- void ThreadCPIDs ()
7717+ void LoadCPIDs ()
77267718{
7727- RenameThread (" grc-cpids" );
7728- bCPIDsLoaded = false ;
7719+ printf (" Load CPID" );
77297720 HarvestCPIDs (true );
7730- bCPIDsLoaded = true ;
7731- // CreditCheck(GlobalCPUMiningCPID.cpid,false);
77327721 printf (" Getting first project" );
77337722 GetNextProject (false );
77347723 printf (" Finished getting first project" );
7735- bProjectsInitialized = true ;
7736- }
7737-
7738-
7739- void LoadCPIDsInBackground ()
7740- {
7741- if (IsLockTimeWithinMinutes (nCPIDsLoaded,10 )) return ;
7742- nCPIDsLoaded = GetAdjustedTime ();
7743- cpidThreads = new boost::thread_group ();
7744- cpidThreads->create_thread (boost::bind (&ThreadCPIDs));
77457724}
77467725
77477726StructCPID GetStructCPID ()
0 commit comments