Skip to content

Commit

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

- CPID/Investor detection issue across versions (This version should
allow all researchers to receive a CPID by default).
- If you are an investor and you end up with a CPID, set 'investor=true'
in the config file.
(This is not a permanent fix; will be working on auto detection next).
  • Loading branch information
gridcoin committed Nov 14, 2015
1 parent 75ded0b commit 9265854
Show file tree
Hide file tree
Showing 5 changed files with 127 additions and 141 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: Fri Nov 13 07:46:56 2015
# Generated by qmake (2.01a) (Qt 4.8.4) on: Fri Nov 13 17:47:47 2015
# Project: gridcoinstake.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: Fri Nov 13 07:46:57 2015
# Generated by qmake (2.01a) (Qt 4.8.4) on: Fri Nov 13 17:47:49 2015
# Project: gridcoinstake.pro
# Template: app
#############################################################################
Expand Down
45 changes: 10 additions & 35 deletions contrib/Installer/GridcoinInstaller/GridcoinResearch.vdproj
Original file line number Diff line number Diff line change
Expand Up @@ -226,19 +226,19 @@
"Entry"
{
"MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_D0966638AB084779AFD69795C33FC8EB"
"OwnerKey" = "8:_6408A3D03D15E306A4C3FC5FD95ADA69"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_7A0EA93E644A4D9E8037FBB3C062DD65"
"OwnerKey" = "8:_32F2DC723F30362B0B78F9A291EC0098"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_6AEABB5004EC4B57225B51B085DB5625"
"OwnerKey" = "8:_DEB886DE05C496A5AD26B43C4B1B90B9"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
Expand All @@ -250,19 +250,19 @@
"Entry"
{
"MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_DEB886DE05C496A5AD26B43C4B1B90B9"
"OwnerKey" = "8:_6AEABB5004EC4B57225B51B085DB5625"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_32F2DC723F30362B0B78F9A291EC0098"
"OwnerKey" = "8:_7A0EA93E644A4D9E8037FBB3C062DD65"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_6408A3D03D15E306A4C3FC5FD95ADA69"
"OwnerKey" = "8:_D0966638AB084779AFD69795C33FC8EB"
"MsmSig" = "8:_UNDEFINED"
}
}
Expand Down Expand Up @@ -437,11 +437,6 @@
"AssemblyAsmDisplayName" = "8:GRCSec, Version=1.0.0.2, Culture=neutral, processorArchitecture=MSIL"
"ScatterAssemblies"
{
"_32F2DC723F30362B0B78F9A291EC0098"
{
"Name" = "8:GRCSec.dll"
"Attributes" = "3:512"
}
}
"SourcePath" = "8:GRCSec.dll"
"TargetName" = "8:"
Expand Down Expand Up @@ -559,11 +554,6 @@
"AssemblyAsmDisplayName" = "8:OpenPop, Version=2.0.5.0, Culture=neutral, processorArchitecture=MSIL"
"ScatterAssemblies"
{
"_5644D8F767F33372E534FBD5A2384D12"
{
"Name" = "8:openpopstake.dll"
"Attributes" = "3:512"
}
}
"SourcePath" = "8:openpopstake.dll"
"TargetName" = "8:"
Expand All @@ -590,11 +580,6 @@
"AssemblyAsmDisplayName" = "8:MySql.Data, Version=6.6.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL"
"ScatterAssemblies"
{
"_6408A3D03D15E306A4C3FC5FD95ADA69"
{
"Name" = "8:MySql.Data.dll"
"Attributes" = "3:512"
}
}
"SourcePath" = "8:MySql.Data.dll"
"TargetName" = "8:"
Expand All @@ -621,11 +606,6 @@
"AssemblyAsmDisplayName" = "8:SQLite.NET, Version=0.21.1869.3794, Culture=neutral, PublicKeyToken=c273bd375e695f9c"
"ScatterAssemblies"
{
"_6AEABB5004EC4B57225B51B085DB5625"
{
"Name" = "8:sqlitestake.net.dll"
"Attributes" = "3:512"
}
}
"SourcePath" = "8:sqlitestake.net.dll"
"TargetName" = "8:"
Expand Down Expand Up @@ -883,11 +863,6 @@
"AssemblyAsmDisplayName" = "8:ICSharpCode.SharpZipLib, Version=0.86.0.518, Culture=neutral, PublicKeyToken=1b03e6acf1164f73"
"ScatterAssemblies"
{
"_DEB886DE05C496A5AD26B43C4B1B90B9"
{
"Name" = "8:icsharpcode.sharpziplib.dll"
"Attributes" = "3:512"
}
}
"SourcePath" = "8:icsharpcode.sharpziplib.dll"
"TargetName" = "8:"
Expand Down Expand Up @@ -1094,19 +1069,19 @@
{
"Name" = "8:Microsoft Visual Studio"
"ProductName" = "8:Gridcoin Research"
"ProductCode" = "8:{AEB15262-03C1-4DCA-AF37-DD09F9BE460B}"
"PackageCode" = "8:{4C846792-97C9-414C-BAB5-DB73F1FE5D2A}"
"ProductCode" = "8:{A2436601-F960-494A-9196-747CD46ED9CB}"
"PackageCode" = "8:{F3F134A8-F941-4D25-9199-D731744F07EC}"
"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:37.3"
"ProductVersion" = "8:37.4"
"Manufacturer" = "8:GridcoinResearch"
"ARPHELPTELEPHONE" = "8:"
"ARPHELPLINK" = "8:"
"Title" = "8:Gridcoin Research Beta 37.3"
"Title" = "8:Gridcoin Research Beta 37.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 3
#define CLIENT_VERSION_BUILD 2
#define CLIENT_VERSION_BUILD 3

// Converts the parameter X to a string after macro replacement on X has been performed.
// Don't merge these into one macro!
Expand Down
217 changes: 114 additions & 103 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8369,130 +8369,141 @@ void HarvestCPIDs(bool cleardata)

int iRow = 0;
std::vector<std::string> vCPID = split(sout.c_str(),"<project>");
if (vCPID.size() > 0)
std::string investor = GetArgument("investor","false");

if (investor=="true")
{
msPrimaryCPID="INVESTOR";
}
else
{

for (unsigned int i = 0; i < vCPID.size(); i++)
{
std::string email_hash = ExtractXML(vCPID[i],"<email_hash>","</email_hash>");
std::string cpidhash = ExtractXML(vCPID[i],"<cross_project_id>","</cross_project_id>");
std::string externalcpid = ExtractXML(vCPID[i],"<external_cpid>","</external_cpid>");

std::string utc=ExtractXML(vCPID[i],"<user_total_credit>","</user_total_credit>");
std::string rac=ExtractXML(vCPID[i],"<user_expavg_credit>","</user_expavg_credit>");
std::string proj=ExtractXML(vCPID[i],"<project_name>","</project_name>");
std::string team=ExtractXML(vCPID[i],"<team_name>","</team_name>");
std::string rectime = ExtractXML(vCPID[i],"<rec_time>","</rec_time>");

if (Contains(vCPID[i],"<external_cpid>") && externalcpid.empty())
if (vCPID.size() > 0)
{
externalcpid="?";
}

boost::to_lower(proj);
proj = ToOfficialName(proj);
bool projectvalid = ProjectIsValid(proj); //Is project Valid
int64_t nStart = GetTimeMillis();
if (cpidhash.length() > 5 && proj.length() > 3)
{
std::string cpid_non = cpidhash+email;
to_lower(cpid_non);
StructCPID structcpid = GetInitializedStructCPID2(proj,mvCPIDs);
iRow++;
structcpid.cpidhash = cpidhash;
structcpid.projectname = proj;
boost::to_lower(team);
structcpid.team = team;
InitializeProjectStruct(structcpid);
int64_t elapsed = GetTimeMillis()-nStart;
if (fDebug3) printf("Enumerating boinc local project %s cpid %s valid %s, elapsed %f ",structcpid.projectname.c_str(),structcpid.cpid.c_str(),YesNo(structcpid.Iscpidvalid).c_str(),(double)elapsed);
structcpid.rac = cdbl(rac,0);
structcpid.verifiedrac = cdbl(rac,0);

if (!structcpid.Iscpidvalid)

for (unsigned int i = 0; i < vCPID.size(); i++)
{
structcpid.errors = "CPID calculation invalid. Check e-mail + reset project.";
}
std::string email_hash = ExtractXML(vCPID[i],"<email_hash>","</email_hash>");
std::string cpidhash = ExtractXML(vCPID[i],"<cross_project_id>","</cross_project_id>");
std::string externalcpid = ExtractXML(vCPID[i],"<external_cpid>","</external_cpid>");

std::string utc=ExtractXML(vCPID[i],"<user_total_credit>","</user_total_credit>");
std::string rac=ExtractXML(vCPID[i],"<user_expavg_credit>","</user_expavg_credit>");
std::string proj=ExtractXML(vCPID[i],"<project_name>","</project_name>");
std::string team=ExtractXML(vCPID[i],"<team_name>","</team_name>");
std::string rectime = ExtractXML(vCPID[i],"<rec_time>","</rec_time>");

if (Contains(vCPID[i],"<external_cpid>") && externalcpid.empty())
{
//externalcpid="?";
}

boost::to_lower(proj);
proj = ToOfficialName(proj);
bool projectvalid = ProjectIsValid(proj); //Is project Valid
int64_t nStart = GetTimeMillis();
if (cpidhash.length() > 5 && proj.length() > 3)
{
std::string cpid_non = cpidhash+email;
to_lower(cpid_non);
StructCPID structcpid = GetInitializedStructCPID2(proj,mvCPIDs);
iRow++;
structcpid.cpidhash = cpidhash;
structcpid.projectname = proj;
boost::to_lower(team);
structcpid.team = team;
InitializeProjectStruct(structcpid);
int64_t elapsed = GetTimeMillis()-nStart;
if (fDebug3) printf("Enumerating boinc local project %s cpid %s valid %s, elapsed %f ",structcpid.projectname.c_str(),structcpid.cpid.c_str(),YesNo(structcpid.Iscpidvalid).c_str(),(double)elapsed);
structcpid.rac = cdbl(rac,0);
structcpid.verifiedrac = cdbl(rac,0);

if (!structcpid.Iscpidvalid)
{
structcpid.errors = "CPID calculation invalid. Check e-mail + reset project.";
}

structcpid.utc = cdbl(utc,0);
structcpid.rectime = cdbl(rectime,0);
double currenttime = GetAdjustedTime();
double nActualTimespan = currenttime - structcpid.rectime;
structcpid.age = nActualTimespan;
//Have credits been verified yet?
//If not, Call out to credit check node:
std::string sKey = structcpid.cpid + ":" + proj;
mvCPIDs[proj] = structcpid;
//structcpid = mvCPIDs[proj];
structcpid.utc = cdbl(utc,0);
structcpid.rectime = cdbl(rectime,0);
double currenttime = GetAdjustedTime();
double nActualTimespan = currenttime - structcpid.rectime;
structcpid.age = nActualTimespan;
//Have credits been verified yet?
//If not, Call out to credit check node:
std::string sKey = structcpid.cpid + ":" + proj;
mvCPIDs[proj] = structcpid;
//structcpid = mvCPIDs[proj];

if (!structcpid.Iscpidvalid)
{
structcpid.errors = "CPID invalid. Check E-mail address.";
}
if (!structcpid.Iscpidvalid)
{
structcpid.errors = "CPID invalid. Check E-mail address.";
}

if (structcpid.rac < 10)
{
structcpid.Iscpidvalid = false;
structcpid.errors = "RAC too low";
}
if (structcpid.rac < 10)
{
structcpid.Iscpidvalid = false;
structcpid.errors = "RAC too low";
}

if (structcpid.verifiedrac < 10)
{
structcpid.Iscpidvalid = false;
structcpid.errors="Verified RAC too low";
}
if (structcpid.verifiedrac < 10)
{
structcpid.Iscpidvalid = false;
structcpid.errors="Verified RAC too low";
}

if (structcpid.team != "gridcoin")
{
structcpid.Iscpidvalid = false;
structcpid.errors = "Team invalid";
}
bool bAcid = true;
if (structcpid.team != "gridcoin")
{
structcpid.Iscpidvalid = false;
structcpid.errors = "Team invalid";
}
bool bAcid = true;

if (!externalcpid.empty())
{
bAcid = CPIDAcidTest2(cpidhash,externalcpid);
if (!bAcid)
{
structcpid.Iscpidvalid = false;
structcpid.errors = "CPID corrupted (ext cpid) ";
printf("Primary cpid corrupted %s \r\n",externalcpid.c_str());
}
mvCPIDs[proj] = structcpid;
}
if (!externalcpid.empty())
{
bAcid = CPIDAcidTest2(cpidhash,externalcpid);
if (!bAcid)
{
structcpid.Iscpidvalid = false;
structcpid.errors = "CPID corrupted (ext cpid) ";
printf("Primary cpid corrupted %s \r\n",externalcpid.c_str());
}
mvCPIDs[proj] = structcpid;
}


//11-12-2015
if (structcpid.Iscpidvalid && bAcid)
{
GlobalCPUMiningCPID.cpidhash = cpidhash;
GlobalCPUMiningCPID.email = email;
GlobalCPUMiningCPID.boincruntimepublickey = cpidhash;
if (structcpid.rac > 10 && structcpid.team=="gridcoin")
//11-12-2015
if (structcpid.Iscpidvalid && bAcid)
{
msPrimaryCPID = structcpid.cpid;
#if defined(WIN32) && defined(QT_GUI)
//Let the Neural Network know what your CPID is so it can be charted:
std::string sXML = "<KEY>PrimaryCPID</KEY><VALUE>" + msPrimaryCPID + "</VALUE>";
std::string sData = qtExecuteDotNetStringFunction("WriteKey",sXML);
#endif
//Try to get a neural RAC report 7-25-2015
bool bResult = AsyncNeuralRequest("explainmag",msPrimaryCPID,5);
GlobalCPUMiningCPID.cpidhash = cpidhash;
GlobalCPUMiningCPID.email = email;
GlobalCPUMiningCPID.boincruntimepublickey = cpidhash;
if (structcpid.rac > 10 && structcpid.team=="gridcoin")
{
msPrimaryCPID = structcpid.cpid;
#if defined(WIN32) && defined(QT_GUI)
//Let the Neural Network know what your CPID is so it can be charted:
std::string sXML = "<KEY>PrimaryCPID</KEY><VALUE>" + msPrimaryCPID + "</VALUE>";
std::string sData = qtExecuteDotNetStringFunction("WriteKey",sXML);
#endif
//Try to get a neural RAC report 7-25-2015
bool bResult = AsyncNeuralRequest("explainmag",msPrimaryCPID,5);
}
}
}

mvCPIDs[proj] = structcpid;
if (fDebug) printf("Adding Local Project %s \r\n",structcpid.cpid.c_str());
mvCPIDs[proj] = structcpid;
if (fDebug) printf("Adding Local Project %s \r\n",structcpid.cpid.c_str());

}
}

}
}

}
if (msPrimaryCPID.empty()) msPrimaryCPID="INVESTOR";
}
// If no valid boinc projects were found:
if (msPrimaryCPID.empty()) msPrimaryCPID="INVESTOR";

}
}

catch (std::exception &e)
{
printf("Error while harvesting CPIDs.\r\n");
Expand Down

0 comments on commit 9265854

Please sign in to comment.