Skip to content

Commit

Permalink
3.4.0.6
Browse files Browse the repository at this point in the history
Gridcoin Research 3.4.0.6/24.5/360
Leisure Upgrade

- Crash problem is definitely fixed
(To verify upgrade version, look for '360' in the about screen)
  • Loading branch information
gridcoin committed Jun 11, 2015
1 parent 2a9dbd6 commit 5a96a5c
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 43 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 Jun 11 15:13:59 2015
# Generated by qmake (2.01a) (Qt 4.8.4) on: Thu Jun 11 16:42:17 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: Thu Jun 11 15:13:59 2015
# Generated by qmake (2.01a) (Qt 4.8.4) on: Thu Jun 11 16:42:17 2015
# Project: gridcoinstake.pro
# Template: app
#############################################################################
Expand Down
52 changes: 18 additions & 34 deletions contrib/Installer/boinc/boinc/Utilization.vb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ Public Class Utilization

Public ReadOnly Property Version As Double
Get
Return 357
Return 360


End Get
End Property
Expand Down Expand Up @@ -354,39 +355,22 @@ Public Class Utilization
End Function
Public Function SyncCPIDsWithDPORNodes(sData As String) As Double
'Write the Gridcoin CPIDs to the Persisted Data System
Dim vCPIDs() As String = Split(sData, "<ROW>")
For x As Integer = 0 To UBound(vCPIDs)
If Len(vCPIDs(x)) > 20 Then
Dim vRow() As String
vRow = Split(vCPIDs(x), "<COL>")
Dim sCPID As String = vRow(0)
Dim sBase As String = vRow(1)
Dim unBase As String = DecodeBase64(sBase)
'contract = GlobalCPUMiningCPID.cpidv2 + ";" + hashRand.GetHex() + ";" + GRCAddress;
Dim vCPIDRow() As String = Split(unBase, ";")
Dim cpidv2 As String = vCPIDRow(0)
Dim BlockHash As String = vCPIDRow(1)
Dim Address As String = vCPIDRow(2)
Dim dr As New Row
dr.Database = "CPID"
dr.Table = "CPIDS"
dr.PrimaryKey = sCPID
dr = Read(dr)
If NeedsSynced(dr) Then
dr.Expiration = DateAdd(DateInterval.Day, 14, Now)
dr.Synced = DateAdd(DateInterval.Day, -1, Now)
dr.DataColumn1 = cpidv2
dr.DataColumn3 = BlockHash
dr.DataColumn4 = Address
Dim bValid As Boolean = False
Dim clsMD5 As New MD5
bValid = clsMD5.CompareCPID(sCPID, cpidv2, BlockHash)
dr.DataColumn5 = Trim(bValid)
Store(dr)
End If
End If
Next
Call SyncDPOR2()


Try
msSyncData = sData

Call SyncDPOR2()

Catch ex As Exception
Log("Exception during SyncDpor2 : " + ex.Message)
Return -2
End Try


Log("Finished syncing DPOR cpids.")

Return 0

End Function
Public Function AddressUser(sMagnitude As String) As Double
Expand Down
51 changes: 51 additions & 0 deletions contrib/Installer/boinc/boinc/modPersistedDataSystem.vb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Module modPersistedDataSystem
'Stale data older than the Expiration shall be purged automatically

'Data is stored across all Gridcoin windows nodes, in a decentralized store
Public msSyncData As String = ""

Private lUseCount As Long = 0
Public Structure Row
Expand Down Expand Up @@ -125,9 +126,56 @@ Module modPersistedDataSystem
If Now > dr.Synced Then Return True Else Return False
End Function
Public Sub CompleteSync()
UpdateMagnitudesPhase1()
UpdateMagnitudes()
End Sub
Public Function UpdateMagnitudesPhase1()
Try

Dim vCPIDs() As String = Split(msSyncData, "<ROW>")
For x As Integer = 0 To UBound(vCPIDs)
If Len(vCPIDs(x)) > 20 Then
Dim vRow() As String
vRow = Split(vCPIDs(x), "<COL>")
Dim sCPID As String = vRow(0)
Dim sBase As String = vRow(1)
Dim unBase As String = DecodeBase64(sBase)
'contract = GlobalCPUMiningCPID.cpidv2 + ";" + hashRand.GetHex() + ";" + GRCAddress;
Dim vCPIDRow() As String = Split(unBase, ";")
Dim cpidv2 As String = vCPIDRow(0)
Dim BlockHash As String = vCPIDRow(1)
Dim Address As String = vCPIDRow(2)
Dim dr As New Row
dr.Database = "CPID"
dr.Table = "CPIDS"
dr.PrimaryKey = sCPID
dr = Read(dr)
If NeedsSynced(dr) Then
dr.Expiration = DateAdd(DateInterval.Day, 14, Now)
dr.Synced = DateAdd(DateInterval.Day, -1, Now)
dr.DataColumn1 = cpidv2
dr.DataColumn3 = BlockHash
dr.DataColumn4 = Address
Dim bValid As Boolean = False
Dim clsMD5 As New MD5
bValid = clsMD5.CompareCPID(sCPID, cpidv2, BlockHash)
dr.DataColumn5 = Trim(bValid)
Store(dr)
End If
End If
Next
Catch ex As Exception
Log("UpdateMagnitudesPhase1: " + ex.Message)
End Try

msSyncData = ""

End Function

Public Function UpdateMagnitudes() As Boolean

Try

'Loop through the researchers
Dim surrogateRow As New Row
surrogateRow.Database = "CPID"
Expand Down Expand Up @@ -178,6 +226,9 @@ Module modPersistedDataSystem
Store(cpid)
Next
Return True
Catch ex As Exception
Log("UpdateMagnitudes: " + ex.Message)
End Try

End Function
Public Function GetList(DataRow As Row, sWildcard As String) As List(Of Row)
Expand Down
9 changes: 2 additions & 7 deletions src/qt/bitcoingui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -486,16 +486,11 @@ void qtSyncWithDPORNodes(std::string data)
{

#if defined(WIN32) && defined(QT_GUI)
try
{
int result = 0;
printf("Syncing with DPOR nodes...\r\n");
QString qsData = ToQstring(data);
result = globalcom->dynamicCall("SyncCPIDsWithDPORNodes(Qstring)",qsData).toInt();
}
catch(...)
{

}
printf("Done syncing.\r\n");
#endif
}

Expand Down

0 comments on commit 5a96a5c

Please sign in to comment.