Skip to content

Commit

Permalink
3.5.7.1-leisure
Browse files Browse the repository at this point in the history
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
  • Loading branch information
gridcoin committed Jul 23, 2016
1 parent 9b50f7e commit e68fbb0
Show file tree
Hide file tree
Showing 8 changed files with 65 additions and 75 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: 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
#############################################################################
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: 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
#############################################################################
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 @@ -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"
Expand All @@ -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"
}
}
Expand Down Expand Up @@ -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:"
Expand Down Expand Up @@ -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:"
Expand All @@ -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:"
Expand All @@ -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:"
Expand Down Expand Up @@ -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:"
Expand Down Expand Up @@ -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"
Expand Down
36 changes: 25 additions & 11 deletions contrib/Installer/boinc/boinc/frmAddExpense.vb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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")
Expand All @@ -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()

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 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!
Expand Down
41 changes: 21 additions & 20 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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
}

Expand Down Expand Up @@ -4867,22 +4867,18 @@ void GridcoinServices()

if (TimerMain("OutOfSync",120))
{
double PORDiff = GetDifficulty(GetLastBlockIndex(pindexBest, true));
bool fGhostChain = (!fTestNet && PORDiff < .75);
if (OutOfSyncByMoreThan(30) || fGhostChain)
if (WalletOutOfSync())
{
RecoverNode();
}
}

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

Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions src/qt/bitcoingui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/rpcblockchain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit e68fbb0

Please sign in to comment.