From e68fbb07f8d68e651d7ce1d20717c85a7bdfbb1a Mon Sep 17 00:00:00 2001 From: Gridcoin Date: Sat, 23 Jul 2016 12:21:31 -0500 Subject: [PATCH] 3.5.7.1-leisure Gridcoin Research 3.5.7.1/MSI=40.6 Leisure Upgrade - Verify compile on Arch - Verify code does not restart client during initial syncing - Bubble error handler messagebox while submitting expense --- Makefile.Debug | 2 +- Makefile.Release | 2 +- .../GridcoinInstaller/GridcoinResearch.vdproj | 45 +++++-------------- .../Installer/boinc/boinc/frmAddExpense.vb | 36 ++++++++++----- src/clientversion.h | 2 +- src/main.cpp | 41 ++++++++--------- src/qt/bitcoingui.cpp | 10 ++--- src/rpcblockchain.cpp | 2 +- 8 files changed, 65 insertions(+), 75 deletions(-) diff --git a/Makefile.Debug b/Makefile.Debug index 7755714c9e..0899d5b965 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: Thu Jul 21 22:07:19 2016 +# Generated by qmake (2.01a) (Qt 4.8.4) on: Sat Jul 23 11:19:53 2016 # Project: gridcoinresearch.pro # Template: app ############################################################################# diff --git a/Makefile.Release b/Makefile.Release index a8c3c3edff..578d31e38c 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: Thu Jul 21 22:07:19 2016 +# Generated by qmake (2.01a) (Qt 4.8.4) on: Sat Jul 23 11:19:54 2016 # Project: gridcoinresearch.pro # Template: app ############################################################################# diff --git a/contrib/Installer/GridcoinInstaller/GridcoinResearch.vdproj b/contrib/Installer/GridcoinInstaller/GridcoinResearch.vdproj index 43b8a0fd33..413ba6f848 100644 --- a/contrib/Installer/GridcoinInstaller/GridcoinResearch.vdproj +++ b/contrib/Installer/GridcoinInstaller/GridcoinResearch.vdproj @@ -232,19 +232,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" @@ -256,19 +256,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" } } @@ -463,11 +463,6 @@ "AssemblyAsmDisplayName" = "8:GRCSec, Version=1.0.0.3, Culture=neutral, processorArchitecture=MSIL" "ScatterAssemblies" { - "_32F2DC723F30362B0B78F9A291EC0098" - { - "Name" = "8:GRCSec.dll" - "Attributes" = "3:512" - } } "SourcePath" = "8:GRCSec.dll" "TargetName" = "8:" @@ -585,11 +580,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:" @@ -616,11 +606,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:" @@ -647,11 +632,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:" @@ -909,11 +889,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:" @@ -1120,19 +1095,19 @@ { "Name" = "8:Microsoft Visual Studio" "ProductName" = "8:Gridcoin Research" - "ProductCode" = "8:{E6621A89-4C37-45A1-AC3F-DD5E299C02C9}" - "PackageCode" = "8:{BC3D09B4-C005-4A03-AB29-585E10E7FEA5}" + "ProductCode" = "8:{2A7BA5CE-9344-42F9-9A1E-6FD7D14BF83D}" + "PackageCode" = "8:{D240F656-F139-4D69-A1DA-3D6D0B3C419A}" "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.5" + "ProductVersion" = "8:40.6" "Manufacturer" = "8:GridcoinResearch" "ARPHELPTELEPHONE" = "8:" "ARPHELPLINK" = "8:" - "Title" = "8:Gridcoin Research 40.5" + "Title" = "8:Gridcoin Research 40.6" "Subject" = "8:" "ARPCONTACT" = "8:The Gridcoin Developers" "Keywords" = "8:Gridcoin Research" diff --git a/contrib/Installer/boinc/boinc/frmAddExpense.vb b/contrib/Installer/boinc/boinc/frmAddExpense.vb index 43ae36d4be..5bcad7d158 100644 --- a/contrib/Installer/boinc/boinc/frmAddExpense.vb +++ b/contrib/Installer/boinc/boinc/frmAddExpense.vb @@ -10,9 +10,13 @@ Public Class frmAddExpense Private sHistoryGuid As String Private Sub frmTicketAdd_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load - mGRCData = New GRCSec.GridcoinData + Try + mGRCData = New GRCSec.GridcoinData + Catch ex As Exception + MsgBox("Unable to load page " + ex.Message, MsgBoxStyle.Critical) + Exit Sub + End Try sHandle = KeyValue("TicketHandle") - Try If Mode <> "View" Then If sHandle = "" Then @@ -143,12 +147,6 @@ Public Class frmAddExpense sTitle += "[Foundation_" + txtTicketId.Text + "]" Dim sQuestion As String = IIf(sType = "Expense", "Approve_Expense?", "Approve_Campaign?") - Dim sAnswers As String = "Approve;Deny" - Dim sResult As String = ExecuteRPCCommand("addpoll", sTitle, "21", sQuestion, sAnswers, "3", "http://www.gridcoin.us") - If Not LCase(sResult).Contains("success") Then - MsgBox(sResult, MsgBoxStyle.Information, "Gridcoin Foundation - Expense System") - Exit Sub - End If 'if they are not logged on... throw an error ... 4-22-2016 If sHandle = "" Then MsgBox("Please create a user name first. After logging in you may re-submit the form.", MsgBoxStyle.Critical, "Not Logged In") @@ -157,9 +155,25 @@ Public Class frmAddExpense Exit Sub End If - mGRCData.mInsertExpense(Mode, txtSubmittedBy.Text, txtTicketId.Text, "All", _ - sType, txtDescription.Text, sType, rtbNotes.Text, MerkleRoot, _ - Trim(dtStart.Text), Trim(dtEnd.Text), Trim(txtAmount.Text), rtbNotes.Text, txtAttachment.Text) + Dim sAnswers As String = "Approve;Deny" + + Try + mGRCData.mInsertExpense(Mode, txtSubmittedBy.Text, txtTicketId.Text, "All", _ + sType, txtDescription.Text, sType, rtbNotes.Text, MerkleRoot, _ + Trim(dtStart.Text), Trim(dtEnd.Text), Trim(txtAmount.Text), rtbNotes.Text, txtAttachment.Text) + + Catch ex As Exception + MsgBox("An error occurred while inserting the new expense [" + ex.Message + "]", MsgBoxStyle.Critical, "Gridcoin Foundation - Expense System") + Exit Sub + End Try + + + Dim sResult As String = ExecuteRPCCommand("addpoll", sTitle, "21", sQuestion, sAnswers, "3", "http://www.gridcoin.us") + If Not LCase(sResult).Contains("success") Then + MsgBox(sResult, MsgBoxStyle.Information, "Gridcoin Foundation - Expense System") + Exit Sub + End If + SetViewMode() diff --git a/src/clientversion.h b/src/clientversion.h index edb72b0095..dcf227fd03 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 7 -#define CLIENT_VERSION_BUILD 0 +#define CLIENT_VERSION_BUILD 1 // 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 c050ca439b..60a12c86b5 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -33,7 +33,7 @@ extern std::string NodeAddress(CNode* pfrom); extern std::string ConvertBinToHex(std::string a); extern std::string ConvertHexToBin(std::string a); extern void AskForOutstandingBlocksForcefully(); - +extern bool WalletOutOfSync(); extern void CleanInboundConnections(); extern void RecoverNode(); @@ -997,7 +997,7 @@ MiningCPID GetNextProject(bool bForce) if (mvCPIDs.size() < 1) { - if (fDebug3 && LessVerbose(10)) printf("Gridcoin has no CPIDs..."); + if (fDebug && LessVerbose(10)) printf("Gridcoin has no CPIDs..."); //Let control reach the investor area } @@ -4867,9 +4867,7 @@ void GridcoinServices() if (TimerMain("OutOfSync",120)) { - double PORDiff = GetDifficulty(GetLastBlockIndex(pindexBest, true)); - bool fGhostChain = (!fTestNet && PORDiff < .75); - if (OutOfSyncByMoreThan(30) || fGhostChain) + if (WalletOutOfSync()) { RecoverNode(); } @@ -4877,12 +4875,10 @@ void GridcoinServices() if (TimerMain("OutOfSyncDaily",900)) { - double PORDiff = GetDifficulty(GetLastBlockIndex(pindexBest, true)); - bool fGhostChain = (!fTestNet && PORDiff < .75); - if (OutOfSyncByMoreThan(30) || fGhostChain) + if (WalletOutOfSync()) { printf("Restarting Gridcoin..."); - #ifdef QT_GUI + #if defined(WIN32) && defined(QT_GUI) int iResult = RestartClient(); #endif } @@ -4932,7 +4928,7 @@ void GridcoinServices() printf (" MRSA %f, BH %f ",(double)superblock_age,(double)nBestHeight); if (nBestHeight==nLastBestHeight) { - printf("\r\n ************ Processing block with the same best height as the last best height... ************* %f\r\n",(double)nBestHeight); + //printf("\r\n ************ Processing block with the same best height as the last best height... ************* %f\r\n",(double)nBestHeight); } } @@ -5130,10 +5126,7 @@ void RecoverNode() void CheckForLatestBlocks() { - bool fOut = OutOfSyncByMoreThan(30); - double PORDiff = GetDifficulty(GetLastBlockIndex(pindexBest, true)); - bool fGhostChain = (!fTestNet && PORDiff < .75); - if (fOut || fGhostChain) + if (WalletOutOfSync()) { mapOrphanBlocks.clear(); setStakeSeen.clear(); @@ -5204,6 +5197,17 @@ void ReloadBlockIndexHot() printf("\r\n * Node Recovered * \r\n"); } +bool WalletOutOfSync() +{ + // Only trigger an out of sync condition if the node has synced near the best block prior to going out of sync. + bool fOut = OutOfSyncByMoreThan(30); + double PORDiff = GetDifficulty(GetLastBlockIndex(pindexBest, true)); + bool fGhostChain = (!fTestNet && PORDiff < .75); + int iPeerBlocks = GetNumBlocksOfPeers(); + bool bSyncedCloseToTop = nBestHeight > iPeerBlocks-1000; + if ((fOut || fGhostChain) && bSyncedCloseToTop) return true; + return false; +} bool ProcessBlock(CNode* pfrom, CBlock* pblock, bool generated_by_me) { @@ -5253,16 +5257,13 @@ bool ProcessBlock(CNode* pfrom, CBlock* pblock, bool generated_by_me) // R HALFORD - 05-13-2016 - If we are out of sync, and get bombarded with orphans, recover the node. if (TimerMain("OrphanBarrage", 40)) { - bool fOut = OutOfSyncByMoreThan(30); - double PORDiff = GetDifficulty(GetLastBlockIndex(pindexBest, true)); - bool fGhostChain = (!fTestNet && PORDiff < .75); - if (fOut || fGhostChain) + if (WalletOutOfSync()) { if (TimerMain("OrphansAndNotRecovering",8)) { printf("\r\nGridcoin has not recovered after clearing orphans; Restarting node...\r\n"); - #ifdef QT_GUI - int iResult = RestartClient(); + #if defined(WIN32) && defined(QT_GUI) + int iResult = RestartClient(); #endif } else diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index ec3dc8aa21..765ba72b77 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -467,14 +467,14 @@ int RestartClient() { if (!bGlobalcomInitialized) return 0; QString sFilename = "GRCRestarter.exe"; - QString sArgument = ""; - QString path = QCoreApplication::applicationDirPath() + "\\" + sFilename; - QProcess p; + QString sArgument = ""; + QString path = QCoreApplication::applicationDirPath() + "\\" + sFilename; + QProcess p; #ifdef WIN32 globalcom->dynamicCall("RebootClient()"); #endif - StartShutdown(); - return 1; + StartShutdown(); + return 1; } void qtUpdateConfirm(std::string txid) diff --git a/src/rpcblockchain.cpp b/src/rpcblockchain.cpp index 5d3f5dbe04..4f3f5a0489 100644 --- a/src/rpcblockchain.cpp +++ b/src/rpcblockchain.cpp @@ -2112,7 +2112,7 @@ Value execute(const Array& params, bool fHelp) { printf("Restarting Gridcoin..."); int iResult = 0; - #ifdef QT_GUI + #if defined(WIN32) && defined(QT_GUI) iResult = RestartClient(); #endif entry.push_back(Pair("Restarting",(double)iResult));