diff --git a/Makefile.Debug b/Makefile.Debug index 5f76b9b83b..7202564592 100644 --- a/Makefile.Debug +++ b/Makefile.Debug @@ -1,6 +1,6 @@ ############################################################################# # Makefile for building: gridcoinresearch -# Generated by qmake (2.01a) (Qt 4.8.4) on: Mon Jun 13 20:01:48 2016 +# Generated by qmake (2.01a) (Qt 4.8.4) on: Sun Jul 10 18:30:27 2016 # Project: gridcoinresearch.pro # Template: app ############################################################################# diff --git a/Makefile.Release b/Makefile.Release index ceed85b87f..c546b16714 100644 --- a/Makefile.Release +++ b/Makefile.Release @@ -1,6 +1,6 @@ ############################################################################# # Makefile for building: gridcoinresearch -# Generated by qmake (2.01a) (Qt 4.8.4) on: Mon Jun 13 20:01:49 2016 +# Generated by qmake (2.01a) (Qt 4.8.4) on: Sun Jul 10 18:30:28 2016 # Project: gridcoinresearch.pro # Template: app ############################################################################# diff --git a/contrib/Installer/GridcoinInstaller/GridcoinResearch.vdproj b/contrib/Installer/GridcoinInstaller/GridcoinResearch.vdproj index 4a9ff72a4e..73b26377b6 100644 --- a/contrib/Installer/GridcoinInstaller/GridcoinResearch.vdproj +++ b/contrib/Installer/GridcoinInstaller/GridcoinResearch.vdproj @@ -1120,19 +1120,19 @@ { "Name" = "8:Microsoft Visual Studio" "ProductName" = "8:Gridcoin Research" - "ProductCode" = "8:{4C308408-9E66-4902-B378-759171FC8276}" - "PackageCode" = "8:{3CAB67D7-6E42-4453-975C-8762730EA179}" + "ProductCode" = "8:{1B5B36AC-1133-4B90-9DDD-FB78D681EF74}" + "PackageCode" = "8:{0FEACEFB-73C9-48EB-A9A6-1B764B5D1225}" "UpgradeCode" = "8:{9617E9EA-252F-43CE-B53E-B48C85F71192}" "AspNetVersion" = "8:4.0.30319.0" "RestartWWWService" = "11:FALSE" "RemovePreviousVersions" = "11:TRUE" "DetectNewerInstalledVersion" = "11:FALSE" "InstallAllUsers" = "11:TRUE" - "ProductVersion" = "8:40.3" + "ProductVersion" = "8:40.4" "Manufacturer" = "8:GridcoinResearch" "ARPHELPTELEPHONE" = "8:" "ARPHELPLINK" = "8:" - "Title" = "8:Gridcoin Research 40.3" + "Title" = "8:Gridcoin Research 40.4" "Subject" = "8:" "ARPCONTACT" = "8:The Gridcoin Developers" "Keywords" = "8:Gridcoin Research" diff --git a/src/clientversion.h b/src/clientversion.h index 789542408b..55b035ae7f 100644 --- a/src/clientversion.h +++ b/src/clientversion.h @@ -9,7 +9,7 @@ #define CLIENT_VERSION_MAJOR 3 #define CLIENT_VERSION_MINOR 5 #define CLIENT_VERSION_REVISION 6 -#define CLIENT_VERSION_BUILD 7 +#define CLIENT_VERSION_BUILD 8 // Converts the parameter X to a string after macro replacement on X has been performed. // Don't merge these into one macro! diff --git a/src/main.cpp b/src/main.cpp index 22705c22e1..b1721a98f9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -197,6 +197,7 @@ extern void RemoveNetworkMagnitude(double LockTime, std::string cpid, MiningCPID unsigned int WHITELISTED_PROJECTS = 0; unsigned int CHECKPOINT_VIOLATIONS = 0; int64_t nLastTallied = 0; +int64_t nLastResync = 0; int64_t nLastPing = 0; int64_t nLastPeek = 0; double nVolatility = .90; @@ -3809,7 +3810,7 @@ bool ShaveChain(CTxDB& txdb, int iHaircut) { int iTarget = 0; int iStart = 0; - printf("Shaving %f blocks off of main chain\n",(double)iHaircut); + printf("Disconnecting %f blocks off of main chain\n",(double)iHaircut); CBlockIndex* pHaircut = NULL; CBlockIndex* pBarber = pindexBest; @@ -3862,7 +3863,7 @@ bool ShaveChain(CTxDB& txdb, int iHaircut) vDisconnect.push_back(pBarber); pBarber = pBarber->pprev; pHaircut = pBarber; - printf("Shaving block %f; ",(double)pBarber->nHeight); + printf(" ;Removing blk %f; ",(double)pBarber->nHeight); } if (!pHaircut) @@ -5047,25 +5048,34 @@ void AskForOutstandingBlocks() } void SyncChain() { + + if (IsLockTimeWithinMinutes(nLastResync,60)) + { + printf("Resync too soon or already in progress. \r\n"); + return; + } + + nLastResync = GetAdjustedTime(); + printf("\r\n * Sync Chain * \r\n"); - //6-11-2016 CTxDB txdb; LOCK(cs_main); - ShaveChain(txdb,200); - AskForOutstandingBlocks(); - std::string sOut = ""; - LoadAdminMessages(true,sOut); - InitializeBoincProjects(); - TallyResearchAverages(true); - ComputeNeuralNetworkSupermajorityHashes(); - LoadCPIDsInBackground(); - printf("\r\n * Finished * \r\n"); + { + ShaveChain(txdb,33); + AskForOutstandingBlocks(); + std::string sOut = ""; + LoadAdminMessages(true,sOut); + InitializeBoincProjects(); + TallyResearchAverages(true); + ComputeNeuralNetworkSupermajorityHashes(); + LoadCPIDsInBackground(); + printf("\r\n * Finished * \r\n"); + } } void RecoverNode() { - SyncChain(); } @@ -5155,7 +5165,7 @@ bool ProcessBlock(CNode* pfrom, CBlock* pblock, bool generated_by_me) if (!mapBlockIndex.count(pblock->hashPrevBlock)) { // R HALFORD - 05-13-2016 - If we are out of sync, and get bombarded with orphans, recover the node. - if (TimerMain("OrphanBarrage", 25)) + if (TimerMain("OrphanBarrage", 100)) { bool fOut = OutOfSyncByMoreThan(30); double PORDiff = GetDifficulty(GetLastBlockIndex(pindexBest, true)); diff --git a/src/main.h b/src/main.h index 8379e9f24b..b5b607cc5c 100644 --- a/src/main.h +++ b/src/main.h @@ -159,6 +159,7 @@ extern int64_t nTransactionFee; extern int64_t nReserveBalance; extern int64_t nMinimumInputValue; extern int64_t nLastTallied; +extern int64_t nLastResync; extern int64_t nLastPing; extern int64_t nLastTalliedNeural; diff --git a/src/rpcblockchain.cpp b/src/rpcblockchain.cpp index 012cd54d48..96a8b4cfb2 100644 --- a/src/rpcblockchain.cpp +++ b/src/rpcblockchain.cpp @@ -2111,7 +2111,6 @@ Value execute(const Array& params, bool fHelp) } else if (sItem == "recover") { - //5-13-2016 RecoverNode(); entry.push_back(Pair("Recover",1)); results.push_back(entry);