Skip to content

Commit

Permalink
3.5.9.4-Leisure
Browse files Browse the repository at this point in the history
Gridcoin Research 3.5.9.4/MSI=42.8
Leisure Upgrade

- Fix neural network missing folder error
- Fix speech bug
- Added checkpoint
  • Loading branch information
gridcoin committed Jul 16, 2017
1 parent fa8e21d commit 79bd760
Show file tree
Hide file tree
Showing 10 changed files with 47 additions and 14 deletions.
10 changes: 5 additions & 5 deletions contrib/Installer/GridcoinInstaller/GridcoinResearch.vdproj
Original file line number Diff line number Diff line change
Expand Up @@ -1109,19 +1109,19 @@
{
"Name" = "8:Microsoft Visual Studio"
"ProductName" = "8:Gridcoin Research"
"ProductCode" = "8:{EB16F04D-5B36-4513-AFF5-6633C440C80A}"
"PackageCode" = "8:{2229A482-65D3-48D5-B16D-A1857C2FAEA9}"
"ProductCode" = "8:{F5B93CF2-10AA-4BFF-AB2E-A84F597721B1}"
"PackageCode" = "8:{880021BC-8CDA-4762-9E39-450F3C39CFB9}"
"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:42.7"
"ProductVersion" = "8:42.8"
"Manufacturer" = "8:GridcoinResearch"
"ARPHELPTELEPHONE" = "8:"
"ARPHELPLINK" = "8:"
"Title" = "8:Gridcoin Research 42.7"
"Title" = "8:Gridcoin Research 42.8"
"Subject" = "8:"
"ARPCONTACT" = "8:The Gridcoin Developers"
"Keywords" = "8:Gridcoin Research"
Expand Down Expand Up @@ -1703,7 +1703,7 @@
{
"{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_7A0EA93E644A4D9E8037FBB3C062DD65"
{
"SourcePath" = "8:..\\boinc\\boinc\\obj\\Release\\BoincStake.dll"
"SourcePath" = "8:..\\boinc\\boinc\\obj\\Debug\\BoincStake.dll"
"TargetName" = "8:"
"Tag" = "8:"
"Folder" = "8:_A31B68165F144F3EBC3FF86D68C9E31B"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,15 +128,16 @@ Public Class Form1
sNet = "PROD"
mU.SetTestNetFlag(sNet)
'mU.ShowVotingConsole()
mU.TestGZIPBoincDownload()
'mU.ExportToCSVFile()
'mU.ExportToCSVFile()
Dim sURL As String = "http://csgrid.org/csg/stats/" 'Try it with Citizen Science Group;

' Dim sHash As String = mU.clsGetBoincProjectHash(sURL)
' MsgBox(sHash)
Dim sContract As String = mU.GetNeuralContract()

Dim sTest As String = sURL + ":1"
' mU.TestGZIPBoincDownload()


Exit Sub
End Sub
Expand Down
7 changes: 6 additions & 1 deletion contrib/Installer/boinc/boinc/SpeechSynthesis.vb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@ Public Class SpeechSynthesis
If Len(sName) = 0 Then sName = "Investor"
Dim sSurname = KeyValue("Surname")
Dim sDayInterval As String = DayInterval()
sSentence = "Good " + sDayInterval + " " + sSurname + " " + sName + ", Your Magnitude is " + Trim(CStr(Magnitude))
Dim sMag As String = "0"
Try
sMag = "0" + Magnitude.ToString()
Catch ex As Exception
End Try
sSentence = "Good " + sDayInterval + " " + sSurname + " " + sName + ", Your Magnitude is " + sMag + "."
If mbTestNet Then sSentence += ",in Test Net." Else mbTestNet += ",in Production."
Speak(sSentence)
Return True
Expand Down
2 changes: 1 addition & 1 deletion contrib/Installer/boinc/boinc/Utilization.vb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Public Class Utilization
Private mlSpeakMagnitude As Double
Public ReadOnly Property Version As Double
Get
Return 416
Return 417
End Get
End Property

Expand Down
7 changes: 7 additions & 0 deletions contrib/Installer/boinc/boinc/modPersistedDataSystem.vb
Original file line number Diff line number Diff line change
Expand Up @@ -1011,6 +1011,13 @@ Module modPersistedDataSystem
Dim oLock As New Object

Dim sNNFolder As String = GetGridFolder() + "NeuralNetwork\" + DataRow.Table + "\"
If Not System.IO.Directory.Exists(sNNFolder) Then
Try
MkDir(sNNFolder)
Catch ex As Exception
Log("Unable to create Neural Network Subfolder : " + sNNFolder)
End Try
End If
Dim bBlacklist As Boolean

SyncLock oLock
Expand Down
1 change: 1 addition & 0 deletions src/checkpoints.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ namespace Checkpoints
(700000, uint256("0x2e45c8a834675b505b96792d198c2dc970f560429c635479c347204044acc59b") )
(770000, uint256("0xfc13a63162bc0a5a09acc3f284cf959d6812a027bb54b342a0e1ccaaca8627ce") )
(850000, uint256("0xc78b15f25ad990d02256907fab92ab37301d129eaea177fd04acacd56c0cbd22") )
(950000, uint256("0x4be0afdb9273d232de0bc75b572d8bcfaa146d9efdbe4a4f1ab775334f175b0f") )
;

// TestNet has no checkpoints
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 9
#define CLIENT_VERSION_BUILD 3
#define CLIENT_VERSION_BUILD 4

// Converts the parameter X to a string after macro replacement on X has been performed.
// Don't merge these into one macro!
Expand Down
23 changes: 21 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3267,8 +3267,25 @@ bool CBlock::ConnectBlock(CTxDB& txdb, CBlockIndex* pindex, bool fJustCheck, boo
(double)OUT_INTEREST,(double)OUT_POR,CoinToDouble(nFees),(double)DPOR_Paid,bb.cpid.c_str());

}

if (bb.lastblockhash != pindex->pprev->GetBlockHash().GetHex())
{
std::string sNarr = "ConnectBlock[ResearchAge] : Historical DPOR Replay attack : lastblockhash != actual last block hash.";
printf("\r\n\r\n ****** %s ***** \r\n",sNarr.c_str());
}


if (IsResearchAgeEnabled(pindex->nHeight) && BlockNeedsChecked(nTime))
{
// Mitigate DPOR Relay attack
// bb.LastBlockhash should be equal to previous index lastblockhash, in order to check block signature correctly and prevent re-use of lastblockhash
if (bb.lastblockhash != pindex->pprev->GetBlockHash().GetHex())
{
std::string sNarr = "ConnectBlock[ResearchAge] : DPOR Replay attack : lastblockhash != actual last block hash.";
printf("\r\n\r\n ****** %s ***** \r\n",sNarr.c_str());
if (fTestNet || (pindex->nHeight > 975000)) return error(" %s ",sNarr.c_str());
}

if (dStakeReward > ((OUT_POR*1.25)+OUT_INTEREST+1+CoinToDouble(nFees)))
{
StructCPID st1 = GetLifetimeCPID(pindex->GetCPID(),"ConnectBlock()");
Expand Down Expand Up @@ -4014,13 +4031,15 @@ bool CBlock::CheckBlock(std::string sCaller, int height1, int64_t Mint, bool fCh
{
// 6-4-2017 - Verify researchers stored block magnitude
double dNeuralNetworkMagnitude = CalculatedMagnitude2(bb.cpid, nTime, false);
if (bb.Magnitude > 0 && bb.Magnitude > (dNeuralNetworkMagnitude*1.25) && (fTestNet || height1 > 947000))
if (bb.Magnitude > 0 && bb.Magnitude > (dNeuralNetworkMagnitude*1.25) && (fTestNet || (!fTestNet && height1 > 947000)))
{
return error("CheckBlock[ResearchAge] : Researchers block magnitude > neural network magnitude: Block Magnitude %f, Neural Network Magnitude %f, CPID %s ",
(double)bb.Magnitude,(double)dNeuralNetworkMagnitude,bb.cpid.c_str());
}
int64_t nCalculatedResearch = GetProofOfStakeReward(nCoinAge, nFees, bb.cpid, true, 1, nTime,
pindexBest, sCaller + "_checkblock_researcher", OUT_POR, OUT_INTEREST, dAccrualAge, dMagnitudeUnit, dAvgMagnitude);


if (bb.ResearchSubsidy > ((OUT_POR*1.25)+1))
{
BusyWaitForTally();
Expand Down Expand Up @@ -4067,7 +4086,7 @@ bool CBlock::CheckBlock(std::string sCaller, int height1, int64_t Mint, bool fCh
LoadAdminMessages(false,sOut2);
if (!fLoadingIndex && !IsCPIDValidv2(bb,height1))
{
return error("Bad CPID : height %f, CPID %s, cpidv2 %s, LBH %s, Bad Hashboinc %s",(double)height1,
return error("Bad CPID or Block Signature : height %f, CPID %s, cpidv2 %s, LBH %s, Bad Hashboinc %s",(double)height1,
bb.cpid.c_str(), bb.cpidv2.c_str(),
bb.lastblockhash.c_str(), vtx[0].hashBoinc.c_str());
}
Expand Down
2 changes: 1 addition & 1 deletion src/qt/rpcconsole.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ void RPCExecutor::request(const QString &command)
}
catch (json_spirit::Object& objError)
{
printf("gridcoinresearch: Handling Error...\r\n");
printf("gridcoinresearch: Handling Error [Request %s]...\r\n",command.toStdString().c_str());

try // Nice formatting for standard-format error
{
Expand Down
2 changes: 1 addition & 1 deletion src/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ bool CWallet::AddToWallet(const CWalletTx& wtxIn)

if (wtxIn.IsCoinBase() || wtxIn.IsCoinStake())
{
printf("\r\nCoinBase:CoinStake\r\n");
if (fDebug10) printf("\r\nCoinBase:CoinStake\r\n");
CBlockIndex* pBlk = mapBlockIndex[wtxIn.hashBlock];
CBlock blk;
bool r = blk.ReadFromDisk(pBlk);
Expand Down

0 comments on commit 79bd760

Please sign in to comment.