Skip to content

Commit

Permalink
3.5.6.8-leisure
Browse files Browse the repository at this point in the history
Gridcoin Research 3.5.6.8/MSI=40.4
Leisure Upgrade

- Refactored Sync/Recover code to sync properly and prevent wallet from
crashing or hanging
  • Loading branch information
gridcoin committed Jul 10, 2016
1 parent 1efbe86 commit 7167d32
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 22 deletions.
2 changes: 1 addition & 1 deletion Makefile.Debug
Original file line number Diff line number Diff line change
@@ -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
#############################################################################
Expand Down
2 changes: 1 addition & 1 deletion Makefile.Release
Original file line number Diff line number Diff line change
@@ -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
#############################################################################
Expand Down
8 changes: 4 additions & 4 deletions contrib/Installer/GridcoinInstaller/GridcoinResearch.vdproj
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion src/clientversion.h
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand Down
38 changes: 24 additions & 14 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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();
}

Expand Down Expand Up @@ -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));
Expand Down
1 change: 1 addition & 0 deletions src/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion src/rpcblockchain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 7167d32

Please sign in to comment.