From 5448bd96cebb2599406021cccfc8bbd95ebcce62 Mon Sep 17 00:00:00 2001 From: gridcoin Date: Sun, 11 Jan 2015 15:54:18 -0600 Subject: [PATCH] 3.3.5.4 Gridcoin Research 3.3.5.4/18.4 Mandatory Upgrade - Control Runaway Difficulty - Starts @114175 Earlier today: - Fixed retally problem during reorganizations - 90 Second block targets - 8 hour coin maturity (increased from 4 hours - TheLostBoy) - 1000 block lookback in Tally Network Averages - Removed PoW - Consolidated PoR RSA_WEIGHT into PoS2.0 Algorithm for the new homogenized PoR algorithm - Added linux support - Added Org messages to every decrypted message in the coin in the log, to allow banning misbehaving nodes - Restored ability to self compile using the last set of keys that I PM'ed : NOTE * Any user who wants to self-compile must PM me for a key. --- Makefile.Debug | 2 +- Makefile.Release | 2 +- .../GridcoinInstaller/GridcoinResearch.vdproj | 31 +++-- .../GridcoinRDTestHarness/Form1.vb | 8 +- contrib/Installer/boinc/boinc/Sql.vb | 1 + .../boinc/boinc/TicketList.Designer.vb | 108 ++++++++++++++++ contrib/Installer/boinc/boinc/TicketList.resx | 120 ++++++++++++++++++ contrib/Installer/boinc/boinc/TicketList.vb | 92 ++++++++++++++ contrib/Installer/boinc/boinc/Utilization.vb | 17 +++ .../Installer/boinc/boinc/boincstake.vbproj | 9 ++ .../boinc/boinc/frmTicketAdd.Designer.vb | 108 +++++++++++----- contrib/Installer/boinc/boinc/frmTicketAdd.vb | 71 ++++++++++- .../boinc/boinc/modBoincLeaderboard.vb | 111 +++++++++++++++- contrib/Installer/boinc/boinc/modGRC.vb | 3 + src/clientversion.h | 2 +- src/kernel.cpp | 29 +++-- src/main.cpp | 2 +- src/version.h | 4 +- 18 files changed, 648 insertions(+), 72 deletions(-) create mode 100644 contrib/Installer/boinc/boinc/TicketList.Designer.vb create mode 100644 contrib/Installer/boinc/boinc/TicketList.resx create mode 100644 contrib/Installer/boinc/boinc/TicketList.vb diff --git a/Makefile.Debug b/Makefile.Debug index 13d477c61c..c8aea3231f 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: Sun Jan 11 11:38:06 2015 +# Generated by qmake (2.01a) (Qt 4.8.4) on: Sun Jan 11 15:49:29 2015 # Project: gridcoinstake.pro # Template: app ############################################################################# diff --git a/Makefile.Release b/Makefile.Release index c2d4c70f12..4d7354b150 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: Sun Jan 11 11:38:06 2015 +# Generated by qmake (2.01a) (Qt 4.8.4) on: Sun Jan 11 15:49:29 2015 # Project: gridcoinstake.pro # Template: app ############################################################################# diff --git a/contrib/Installer/GridcoinInstaller/GridcoinResearch.vdproj b/contrib/Installer/GridcoinInstaller/GridcoinResearch.vdproj index 10fc0f1c14..d4f155eba7 100644 --- a/contrib/Installer/GridcoinInstaller/GridcoinResearch.vdproj +++ b/contrib/Installer/GridcoinInstaller/GridcoinResearch.vdproj @@ -166,13 +166,13 @@ "Entry" { "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_5644D8F767F33372E534FBD5A2384D12" + "OwnerKey" = "8:_D0966638AB084779AFD69795C33FC8EB" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_6AEABB5004EC4B57225B51B085DB5625" + "OwnerKey" = "8:_DEB886DE05C496A5AD26B43C4B1B90B9" "MsmSig" = "8:_UNDEFINED" } "Entry" @@ -184,13 +184,13 @@ "Entry" { "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_DEB886DE05C496A5AD26B43C4B1B90B9" + "OwnerKey" = "8:_6AEABB5004EC4B57225B51B085DB5625" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_D0966638AB084779AFD69795C33FC8EB" + "OwnerKey" = "8:_5644D8F767F33372E534FBD5A2384D12" "MsmSig" = "8:_UNDEFINED" } } @@ -416,6 +416,11 @@ "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:" @@ -442,6 +447,11 @@ "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:" @@ -659,6 +669,11 @@ "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:" @@ -844,16 +859,16 @@ "Product" { "Name" = "8:Microsoft Visual Studio" - "ProductName" = "8:Gridcoin Research 18.2" - "ProductCode" = "8:{718F2C63-B1CA-408D-B51F-2CCE33BB10B3}" - "PackageCode" = "8:{2FE0548D-8992-4A61-876D-7673AA8F3908}" + "ProductName" = "8:Gridcoin Research 18.4" + "ProductCode" = "8:{E199A4E4-877E-46C2-9FBF-C5516CF6F5C7}" + "PackageCode" = "8:{0792A521-07C4-4F74-8D5D-5A4D2BF63A7E}" "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:18.2" + "ProductVersion" = "8:18.4" "Manufacturer" = "8:GridcoinResearch" "ARPHELPTELEPHONE" = "8:" "ARPHELPLINK" = "8:" diff --git a/contrib/Installer/GridcoinRDTestHarness/GridcoinRDTestHarness/Form1.vb b/contrib/Installer/GridcoinRDTestHarness/GridcoinRDTestHarness/Form1.vb index b26f5ae9dc..5ba2448f74 100644 --- a/contrib/Installer/GridcoinRDTestHarness/GridcoinRDTestHarness/Form1.vb +++ b/contrib/Installer/GridcoinRDTestHarness/GridcoinRDTestHarness/Form1.vb @@ -124,18 +124,12 @@ Public Class Form1 End Function Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim x As New Utilization - x.ShowTicker() - - 'x.UpdateConfirm("085e0b60fd229e1ce8a28c8d32a17b081e9810793ab4879dfbe34beda454dc5d") - 'Dim l As Long = x.TrackConfirm("085e0b60fd229e1ce8a28c8d32a17b081e9810793ab4879dfbe34beda454dc5d") - 'l = x.TrackConfirm("085e0b60fd229e1ce8a28c8d32a17b081e9810793ab4879dfbe34beda454dc5d") + x.ShowTicketList() End Sub - - Public Sub RewriteSourceFile(sPATHH As String, sSFileIn As String) Dim sFileIn As String sFileIn = sPATHH + sSFileIn diff --git a/contrib/Installer/boinc/boinc/Sql.vb b/contrib/Installer/boinc/boinc/Sql.vb index 6a4ce9fbc4..86cafe2041 100644 --- a/contrib/Installer/boinc/boinc/Sql.vb +++ b/contrib/Installer/boinc/boinc/Sql.vb @@ -145,6 +145,7 @@ Public Class Sql sHost = GetMasterNodeURL() sData = SQLQuery(sHost, sCommand) If sData = "" Then Return sData + If sData <> "" And x = 9 Then Return sData Catch ex As Exception Log(ex.Message) diff --git a/contrib/Installer/boinc/boinc/TicketList.Designer.vb b/contrib/Installer/boinc/boinc/TicketList.Designer.vb new file mode 100644 index 0000000000..5c7d129f3d --- /dev/null +++ b/contrib/Installer/boinc/boinc/TicketList.Designer.vb @@ -0,0 +1,108 @@ + _ +Partial Class frmTicketList + Inherits System.Windows.Forms.Form + + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer + + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.Label3 = New System.Windows.Forms.Label() + Me.btnRefresh = New System.Windows.Forms.Button() + Me.cmbFilter = New System.Windows.Forms.ComboBox() + Me.tvTicketHistory = New System.Windows.Forms.TreeView() + Me.btnAdd = New System.Windows.Forms.Button() + Me.SuspendLayout() + ' + 'Label3 + ' + Me.Label3.AutoSize = True + Me.Label3.ForeColor = System.Drawing.Color.Lime + Me.Label3.Location = New System.Drawing.Point(70, 22) + Me.Label3.Name = "Label3" + Me.Label3.Size = New System.Drawing.Size(90, 13) + Me.Label3.TabIndex = 5 + Me.Label3.Text = "Show Tickets for:" + ' + 'btnRefresh + ' + Me.btnRefresh.BackColor = System.Drawing.Color.Gray + Me.btnRefresh.ForeColor = System.Drawing.Color.Lime + Me.btnRefresh.Location = New System.Drawing.Point(824, 569) + Me.btnRefresh.Name = "btnRefresh" + Me.btnRefresh.Size = New System.Drawing.Size(78, 29) + Me.btnRefresh.TabIndex = 13 + Me.btnRefresh.Text = "Refresh" + Me.btnRefresh.UseVisualStyleBackColor = False + ' + 'cmbFilter + ' + Me.cmbFilter.BackColor = System.Drawing.Color.FromArgb(CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer)) + Me.cmbFilter.ForeColor = System.Drawing.Color.Lime + Me.cmbFilter.FormattingEnabled = True + Me.cmbFilter.Location = New System.Drawing.Point(171, 13) + Me.cmbFilter.Name = "cmbFilter" + Me.cmbFilter.Size = New System.Drawing.Size(302, 21) + Me.cmbFilter.TabIndex = 14 + ' + 'tvTicketHistory + ' + Me.tvTicketHistory.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _ + Or System.Windows.Forms.AnchorStyles.Left) _ + Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.tvTicketHistory.BackColor = System.Drawing.Color.FromArgb(CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer)) + Me.tvTicketHistory.ForeColor = System.Drawing.Color.Lime + Me.tvTicketHistory.Location = New System.Drawing.Point(73, 59) + Me.tvTicketHistory.Name = "tvTicketHistory" + Me.tvTicketHistory.Size = New System.Drawing.Size(745, 475) + Me.tvTicketHistory.TabIndex = 16 + ' + 'btnAdd + ' + Me.btnAdd.BackColor = System.Drawing.Color.Gray + Me.btnAdd.ForeColor = System.Drawing.Color.Lime + Me.btnAdd.Location = New System.Drawing.Point(726, 14) + Me.btnAdd.Name = "btnAdd" + Me.btnAdd.Size = New System.Drawing.Size(78, 29) + Me.btnAdd.TabIndex = 15 + Me.btnAdd.Text = "Add" + Me.btnAdd.UseVisualStyleBackColor = False + ' + 'frmTicketList + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.BackColor = System.Drawing.Color.Black + Me.ClientSize = New System.Drawing.Size(937, 666) + Me.Controls.Add(Me.tvTicketHistory) + Me.Controls.Add(Me.btnAdd) + Me.Controls.Add(Me.cmbFilter) + Me.Controls.Add(Me.btnRefresh) + Me.Controls.Add(Me.Label3) + Me.Name = "frmTicketList" + Me.Text = "Gridcoin - Add or Edit Ticket" + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + Friend WithEvents Label3 As System.Windows.Forms.Label + Friend WithEvents btnRefresh As System.Windows.Forms.Button + Friend WithEvents cmbFilter As System.Windows.Forms.ComboBox + Private WithEvents tvTicketHistory As System.Windows.Forms.TreeView + Friend WithEvents btnAdd As System.Windows.Forms.Button +End Class diff --git a/contrib/Installer/boinc/boinc/TicketList.resx b/contrib/Installer/boinc/boinc/TicketList.resx new file mode 100644 index 0000000000..1af7de150c --- /dev/null +++ b/contrib/Installer/boinc/boinc/TicketList.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/contrib/Installer/boinc/boinc/TicketList.vb b/contrib/Installer/boinc/boinc/TicketList.vb new file mode 100644 index 0000000000..23e4a84c32 --- /dev/null +++ b/contrib/Installer/boinc/boinc/TicketList.vb @@ -0,0 +1,92 @@ +Imports System.Windows.Forms + +Public Class frmTicketList + Public myGuid As String + Public WithEvents cms As New ContextMenuStrip + + Private Sub frmTicketList_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load + cmbFilter.Items.Add("My Tickets") + cmbFilter.Items.Add("Notices") + cmbFilter.Items.Add("All Tickets") + + 'Add Handlers for Ticket History Select + AddHandler tvTicketHistory.AfterSelect, AddressOf TicketSelected + AddHandler tvTicketHistory.MouseDown, AddressOf TicketRightClick + + + PopulateTickets() + + + + End Sub + Private Sub TicketRightClick(ByVal sender As Object, ByVal e As MouseEventArgs) + + If e.Button = Windows.Forms.MouseButtons.Left Then + If tvTicketHistory.ContextMenuStrip Is Nothing Then Exit Sub + tvTicketHistory.ContextMenuStrip.Visible = False + End If + + If e.Button = Windows.Forms.MouseButtons.Right Then + tvTicketHistory.SelectedNode = tvTicketHistory.GetNodeAt(e.X, e.Y) + cms.Items.Clear() + cms.Items.Add("Open Ticket") + AddHandler cms.Items(0).Click, AddressOf TicketSelected + 'c'ms.Items.Add("Forward Message") + 'AddHandler cms.Items(1).Click, AddressOf MenuForwardMessageClick + tvTicketHistory.ContextMenuStrip = cms + tvTicketHistory.ContextMenuStrip.Show() + End If + + End Sub + + Private Sub TicketSelected(ByVal sender As Object, ByVal e As TreeViewEventArgs) + + Dim sID As String = tvTicketHistory.SelectedNode.Tag + + + Dim ta As New frmTicketAdd + ta.ShowTicket(sID) + + + End Sub + Public Sub PopulateTickets() + tvTicketHistory.Nodes.Clear() + Dim sFilter As String = "" + Select Case cmbFilter.Text + Case "My Tickets" + sFilter = " where AssignedTo = 'Halford' " + Case "All Tickets" + sFilter = "" + Case "Notices" + sFilter = " where Type = 'Notices' " + End Select + Dim dr As GridcoinReader = mGetFilteredTickets(sFilter) + If dr Is Nothing Then Exit Sub + For i As Integer = 1 To dr.Rows + 'Dim Grr As GridcoinReader.GridcoinRow = dr.GetRow(i) + Dim sRow As String = dr.Value(i, "Disposition") + " - " + Mid(dr.Value(i, "Descrip"), 1, 80) _ + + " - " + dr.Value(i, "AssignedTo") + " - " + dr.Value(i, "Added") + Dim node As TreeNode = New TreeNode(sRow) + ' node.Tag = dr.Value(i, "id").ToString() + node.Tag = dr.Value(i, "ticketId").ToString() + + tvTicketHistory.Nodes.Add(node) + Next i + + End Sub + Private Sub cmbFilter_SelectedIndexChanged(sender As System.Object, e As System.EventArgs) Handles cmbFilter.SelectedIndexChanged + PopulateTickets() + + End Sub + + Private Sub btnSubmit_Click(sender As System.Object, e As System.EventArgs) + + End Sub + + Private Sub btnFind_Click(sender As System.Object, e As System.EventArgs) Handles btnAdd.Click + Dim nt As New frmTicketAdd + nt.AddTicket() + nt.Show() + + End Sub +End Class \ No newline at end of file diff --git a/contrib/Installer/boinc/boinc/Utilization.vb b/contrib/Installer/boinc/boinc/Utilization.vb index 756d72cc5c..001c6517f4 100644 --- a/contrib/Installer/boinc/boinc/Utilization.vb +++ b/contrib/Installer/boinc/boinc/Utilization.vb @@ -213,6 +213,23 @@ Public Class Utilization Log("Error while transitioning to frmSQL" + ex.Message) End Try End Function + Public Function ShowTicketAdd() + Try + mfrmTicketAdd = New frmTicketAdd + mfrmTicketAdd.Show() + Catch ex As Exception + Log("Error while transitioning to frmTicketAdd" + ex.Message) + End Try + End Function + Public Function ShowTicketList() + Try + mfrmTicketList = New frmTicketList + mfrmTicketList.Show() + Catch ex As Exception + Log("Error while transitioning to frmTicketAdd" + ex.Message) + End Try + End Function + Public Function ShowTicker() Try mfrmTicker = New frmLiveTicker diff --git a/contrib/Installer/boinc/boinc/boincstake.vbproj b/contrib/Installer/boinc/boinc/boincstake.vbproj index c3981e93db..73a725ea87 100644 --- a/contrib/Installer/boinc/boinc/boincstake.vbproj +++ b/contrib/Installer/boinc/boinc/boincstake.vbproj @@ -85,6 +85,12 @@ + + TicketList.vb + + + Form + frmGRCWireFrameCanvasRenderer.vb @@ -175,6 +181,9 @@ + + TicketList.vb + frmGRCWireFrameCanvasRenderer.vb diff --git a/contrib/Installer/boinc/boinc/frmTicketAdd.Designer.vb b/contrib/Installer/boinc/boinc/frmTicketAdd.Designer.vb index 86400289a3..e47db6cdea 100644 --- a/contrib/Installer/boinc/boinc/frmTicketAdd.Designer.vb +++ b/contrib/Installer/boinc/boinc/frmTicketAdd.Designer.vb @@ -26,7 +26,7 @@ Partial Class frmTicketAdd Me.cmbAssignedTo = New System.Windows.Forms.ComboBox() Me.rtbNotes = New System.Windows.Forms.RichTextBox() Me.Label2 = New System.Windows.Forms.Label() - Me.TextBox1 = New System.Windows.Forms.TextBox() + Me.txtDescription = New System.Windows.Forms.TextBox() Me.Label3 = New System.Windows.Forms.Label() Me.Label4 = New System.Windows.Forms.Label() Me.cmbDisposition = New System.Windows.Forms.ComboBox() @@ -34,14 +34,17 @@ Partial Class frmTicketAdd Me.Label5 = New System.Windows.Forms.Label() Me.btnSubmit = New System.Windows.Forms.Button() Me.Label6 = New System.Windows.Forms.Label() - Me.listMessages = New System.Windows.Forms.TreeView() + Me.tvTicketHistory = New System.Windows.Forms.TreeView() + Me.btnRefresh = New System.Windows.Forms.Button() + Me.cmbType = New System.Windows.Forms.ComboBox() + Me.Label7 = New System.Windows.Forms.Label() Me.SuspendLayout() ' 'Label1 ' Me.Label1.AutoSize = True Me.Label1.ForeColor = System.Drawing.Color.Lime - Me.Label1.Location = New System.Drawing.Point(71, 47) + Me.Label1.Location = New System.Drawing.Point(71, 42) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(69, 13) Me.Label1.TabIndex = 0 @@ -49,10 +52,10 @@ Partial Class frmTicketAdd ' 'cmbAssignedTo ' - Me.cmbAssignedTo.BackColor = System.Drawing.Color.Silver - Me.cmbAssignedTo.ForeColor = System.Drawing.Color.Yellow + Me.cmbAssignedTo.BackColor = System.Drawing.Color.FromArgb(CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer)) + Me.cmbAssignedTo.ForeColor = System.Drawing.Color.Lime Me.cmbAssignedTo.FormattingEnabled = True - Me.cmbAssignedTo.Location = New System.Drawing.Point(146, 39) + Me.cmbAssignedTo.Location = New System.Drawing.Point(146, 34) Me.cmbAssignedTo.Name = "cmbAssignedTo" Me.cmbAssignedTo.Size = New System.Drawing.Size(313, 21) Me.cmbAssignedTo.TabIndex = 1 @@ -71,20 +74,20 @@ Partial Class frmTicketAdd ' Me.Label2.AutoSize = True Me.Label2.ForeColor = System.Drawing.Color.Lime - Me.Label2.Location = New System.Drawing.Point(71, 118) + Me.Label2.Location = New System.Drawing.Point(71, 127) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(63, 13) Me.Label2.TabIndex = 3 Me.Label2.Text = "Description:" ' - 'TextBox1 + 'txtDescription ' - Me.TextBox1.BackColor = System.Drawing.Color.Silver - Me.TextBox1.ForeColor = System.Drawing.Color.Yellow - Me.TextBox1.Location = New System.Drawing.Point(146, 111) - Me.TextBox1.Name = "TextBox1" - Me.TextBox1.Size = New System.Drawing.Size(312, 20) - Me.TextBox1.TabIndex = 4 + Me.txtDescription.BackColor = System.Drawing.Color.FromArgb(CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer)) + Me.txtDescription.ForeColor = System.Drawing.Color.Lime + Me.txtDescription.Location = New System.Drawing.Point(145, 120) + Me.txtDescription.Name = "txtDescription" + Me.txtDescription.Size = New System.Drawing.Size(312, 20) + Me.txtDescription.TabIndex = 4 ' 'Label3 ' @@ -100,7 +103,7 @@ Partial Class frmTicketAdd ' Me.Label4.AutoSize = True Me.Label4.ForeColor = System.Drawing.Color.Lime - Me.Label4.Location = New System.Drawing.Point(71, 79) + Me.Label4.Location = New System.Drawing.Point(73, 101) Me.Label4.Name = "Label4" Me.Label4.Size = New System.Drawing.Size(61, 13) Me.Label4.TabIndex = 6 @@ -108,10 +111,10 @@ Partial Class frmTicketAdd ' 'cmbDisposition ' - Me.cmbDisposition.BackColor = System.Drawing.Color.Silver - Me.cmbDisposition.ForeColor = System.Drawing.Color.Yellow + Me.cmbDisposition.BackColor = System.Drawing.Color.FromArgb(CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer)) + Me.cmbDisposition.ForeColor = System.Drawing.Color.Lime Me.cmbDisposition.FormattingEnabled = True - Me.cmbDisposition.Location = New System.Drawing.Point(145, 76) + Me.cmbDisposition.Location = New System.Drawing.Point(144, 93) Me.cmbDisposition.Name = "cmbDisposition" Me.cmbDisposition.Size = New System.Drawing.Size(313, 21) Me.cmbDisposition.TabIndex = 7 @@ -140,7 +143,7 @@ Partial Class frmTicketAdd ' Me.btnSubmit.BackColor = System.Drawing.Color.Gray Me.btnSubmit.ForeColor = System.Drawing.Color.Lime - Me.btnSubmit.Location = New System.Drawing.Point(482, 102) + Me.btnSubmit.Location = New System.Drawing.Point(481, 111) Me.btnSubmit.Name = "btnSubmit" Me.btnSubmit.Size = New System.Drawing.Size(78, 29) Me.btnSubmit.TabIndex = 10 @@ -157,17 +160,48 @@ Partial Class frmTicketAdd Me.Label6.TabIndex = 11 Me.Label6.Text = "History:" ' - 'listMessages + 'tvTicketHistory ' - Me.listMessages.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _ + Me.tvTicketHistory.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _ Or System.Windows.Forms.AnchorStyles.Left) _ Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.listMessages.BackColor = System.Drawing.Color.FromArgb(CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer)) - Me.listMessages.ForeColor = System.Drawing.Color.Lime - Me.listMessages.Location = New System.Drawing.Point(73, 451) - Me.listMessages.Name = "listMessages" - Me.listMessages.Size = New System.Drawing.Size(745, 147) - Me.listMessages.TabIndex = 12 + Me.tvTicketHistory.BackColor = System.Drawing.Color.FromArgb(CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer)) + Me.tvTicketHistory.ForeColor = System.Drawing.Color.Lime + Me.tvTicketHistory.Location = New System.Drawing.Point(73, 451) + Me.tvTicketHistory.Name = "tvTicketHistory" + Me.tvTicketHistory.Size = New System.Drawing.Size(745, 147) + Me.tvTicketHistory.TabIndex = 12 + ' + 'btnRefresh + ' + Me.btnRefresh.BackColor = System.Drawing.Color.Gray + Me.btnRefresh.ForeColor = System.Drawing.Color.Lime + Me.btnRefresh.Location = New System.Drawing.Point(824, 569) + Me.btnRefresh.Name = "btnRefresh" + Me.btnRefresh.Size = New System.Drawing.Size(78, 29) + Me.btnRefresh.TabIndex = 13 + Me.btnRefresh.Text = "Refresh" + Me.btnRefresh.UseVisualStyleBackColor = False + ' + 'cmbType + ' + Me.cmbType.BackColor = System.Drawing.Color.FromArgb(CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer)) + Me.cmbType.ForeColor = System.Drawing.Color.Lime + Me.cmbType.FormattingEnabled = True + Me.cmbType.Location = New System.Drawing.Point(146, 61) + Me.cmbType.Name = "cmbType" + Me.cmbType.Size = New System.Drawing.Size(313, 21) + Me.cmbType.TabIndex = 15 + ' + 'Label7 + ' + Me.Label7.AutoSize = True + Me.Label7.ForeColor = System.Drawing.Color.Lime + Me.Label7.Location = New System.Drawing.Point(73, 69) + Me.Label7.Name = "Label7" + Me.Label7.Size = New System.Drawing.Size(61, 13) + Me.Label7.TabIndex = 14 + Me.Label7.Text = "Disposition:" ' 'frmTicketAdd ' @@ -175,7 +209,10 @@ Partial Class frmTicketAdd Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.BackColor = System.Drawing.Color.Black Me.ClientSize = New System.Drawing.Size(937, 666) - Me.Controls.Add(Me.listMessages) + Me.Controls.Add(Me.cmbType) + Me.Controls.Add(Me.Label7) + Me.Controls.Add(Me.btnRefresh) + Me.Controls.Add(Me.tvTicketHistory) Me.Controls.Add(Me.Label6) Me.Controls.Add(Me.btnSubmit) Me.Controls.Add(Me.txtTicketId) @@ -183,22 +220,22 @@ Partial Class frmTicketAdd Me.Controls.Add(Me.cmbDisposition) Me.Controls.Add(Me.Label4) Me.Controls.Add(Me.Label3) - Me.Controls.Add(Me.TextBox1) + Me.Controls.Add(Me.txtDescription) Me.Controls.Add(Me.Label2) Me.Controls.Add(Me.rtbNotes) Me.Controls.Add(Me.cmbAssignedTo) Me.Controls.Add(Me.Label1) Me.Name = "frmTicketAdd" Me.Text = "Gridcoin - Add or Edit Ticket" - Me.ResumeLayout(False) - Me.PerformLayout() + Me.ResumeLayout(false) + Me.PerformLayout - End Sub +End Sub Friend WithEvents Label1 As System.Windows.Forms.Label Friend WithEvents cmbAssignedTo As System.Windows.Forms.ComboBox Friend WithEvents rtbNotes As System.Windows.Forms.RichTextBox Friend WithEvents Label2 As System.Windows.Forms.Label - Friend WithEvents TextBox1 As System.Windows.Forms.TextBox + Friend WithEvents txtDescription As System.Windows.Forms.TextBox Friend WithEvents Label3 As System.Windows.Forms.Label Friend WithEvents Label4 As System.Windows.Forms.Label Friend WithEvents cmbDisposition As System.Windows.Forms.ComboBox @@ -206,5 +243,8 @@ Partial Class frmTicketAdd Friend WithEvents Label5 As System.Windows.Forms.Label Friend WithEvents btnSubmit As System.Windows.Forms.Button Friend WithEvents Label6 As System.Windows.Forms.Label - Private WithEvents listMessages As System.Windows.Forms.TreeView + Private WithEvents tvTicketHistory As System.Windows.Forms.TreeView + Friend WithEvents btnRefresh As System.Windows.Forms.Button + Friend WithEvents cmbType As System.Windows.Forms.ComboBox + Friend WithEvents Label7 As System.Windows.Forms.Label End Class diff --git a/contrib/Installer/boinc/boinc/frmTicketAdd.vb b/contrib/Installer/boinc/boinc/frmTicketAdd.vb index 32c19e146f..ac4bbc4c83 100644 --- a/contrib/Installer/boinc/boinc/frmTicketAdd.vb +++ b/contrib/Installer/boinc/boinc/frmTicketAdd.vb @@ -1,11 +1,14 @@ -Public Class frmTicketAdd +Imports System.Windows.Forms + +Public Class frmTicketAdd + Public myGuid As String + Public Mode As String Private Sub frmTicketAdd_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load cmbAssignedTo.Items.Add("Rob Halford") cmbAssignedTo.Items.Add("Gridcoin") cmbAssignedTo.Items.Add("All") - cmbAssignedTo.Items.Add("Notices") - + 'Dispositions cmbDisposition.Items.Add("Programming") cmbDisposition.Items.Add("Research") @@ -17,9 +20,67 @@ cmbDisposition.Items.Add("Budget Approval") cmbDisposition.Items.Add("Closed") - If Val(txtTicketId.Text) = 0 Then - txtTicketId.Text = "1" + 'Types + cmbType.Items.Add("Code Change") + cmbType.Items.Add("Customer Service") + cmbType.Items.Add("Notice") + + + + End Sub + Public Sub ShowTicket(sId As String) + txtTicketId.Text = sId + Call frmTicketAdd_Load(Me, Nothing) + PopulateHistory() + + Me.Show() + + End Sub + + Public Sub AddTicket() + Mode = "Add" + + If Mode = "Add" Then + If Val(txtTicketId.Text) = 0 Then + Dim maxTick As Double = P2PMax("TicketId", "Ticket", "", "") + txtTicketId.Text = Trim(maxTick + 1) + + End If End If End Sub + Private Sub btnSubmit_Click(sender As System.Object, e As System.EventArgs) Handles btnSubmit.Click + ' Add the new ticket + mInsertTicket(txtTicketId.Text, cmbAssignedTo.Text, cmbDisposition.Text, txtDescription.Text, cmbType.Text, rtbNotes.Text) + PopulateHistory() + + End Sub + + + Public Sub PopulateHistory() + + Dim count As Integer + tvTicketHistory.Nodes.Clear() + + Dim dr As GridcoinReader = mGetTicketHistory(txtTicketId.Text) + If dr Is Nothing Then Exit Sub + + For i As Integer = 1 To dr.Rows + 'Dim Grr As GridcoinReader.GridcoinRow = dr.GetRow(i) + + + Dim sRow As String = dr.Value(i, "Disposition") + " - " + Mid(dr.Value(i, "notes"), 1, 80) _ + + " - " + dr.Value(i, "AssignedTo") + " - " + dr.Value(i, "updated") + Dim node As TreeNode = New TreeNode(sRow) + node.Tag = dr.Value(i, "id").ToString() + + tvTicketHistory.Nodes.Add(node) + Next i + + End Sub + + Private Sub btnRefresh_Click(sender As System.Object, e As System.EventArgs) Handles btnRefresh.Click + Call PopulateHistory() + + End Sub End Class \ No newline at end of file diff --git a/contrib/Installer/boinc/boinc/modBoincLeaderboard.vb b/contrib/Installer/boinc/boinc/modBoincLeaderboard.vb index dad652e8d7..a1f6fa8d5c 100644 --- a/contrib/Installer/boinc/boinc/modBoincLeaderboard.vb +++ b/contrib/Installer/boinc/boinc/modBoincLeaderboard.vb @@ -23,6 +23,27 @@ sErr = mData.ExecuteP2P(sInsert) Return sErr End Function + + Public Function mInsertTicket(sTicketId As String, sAssignedTo As String, sDisposition As String, sDesc As String, sType As String, sNotes As String) As String + If mData Is Nothing Then mData = New Sql + Dim sInsert As String + sInsert = "Ticket
TicketId,AssignedTo,Disposition,Descript,Type'" _ + + Trim(sTicketId) + "','" + Trim(sAssignedTo) + "','" + Trim(sDisposition) + "','" + Trim(sDesc) + "','" + Trim(sType) + "'
" + Dim sErr As String = "" + sErr = mData.ExecuteP2P(sInsert) + If Len(sErr) > 1 Then + MsgBox(sErr, MsgBoxStyle.Critical, "Error while Creating Ticket") + Exit Function + End If + 'Retrieve ticket Guid + Dim sGuid As String = P2PValue("id", "Ticket", "TicketId", sTicketId) + If (Len(sGuid) > 10) Then + sInsert = "TicketHistory
Parent,Disposition,AssignedTo,Notes'" + Trim(sGuid) + "','" + Trim(sDisposition) + "','" + Trim(sAssignedTo) + "','" + Trim(sNotes) + "'
" + sErr += mData.ExecuteP2P(sInsert) + End If + Return sErr + End Function + Public msTXID As String = "" Public Function mUpdateConfirmAsync() @@ -50,8 +71,6 @@ End Function Public Function mTrackConfirm(sTXID As String) As Double - - If mData Is Nothing Then mData = New Sql Dim dr As GridcoinReader @@ -78,9 +97,97 @@ Return 0 End Try + End Function + + Public Function mGetFilteredTickets(sFilter As String) As GridcoinReader + If mData Is Nothing Then mData = New Sql + + Dim dr As GridcoinReader + Dim sql As String + + + + sql = "Select * From Ticket " + sFilter + + Try + dr = mData.GetGridcoinReader(sql) + Catch ex As Exception + Return dr + End Try + Return dr + End Function + Public Function mGetTicketHistory(sTicketID As String) As GridcoinReader + If mData Is Nothing Then mData = New Sql + Dim myGuid As String + myGuid = P2PValue("id", "Ticket", "TicketId", sTicketID) + + Dim dr As GridcoinReader + If myGuid = "" Then Return dr + + + Dim sql As String + sql = "Select * From TicketHistory where Parent='" + myGuid + "'" + Try + dr = mData.GetGridcoinReader(sql) + Catch ex As Exception + Return dr + End Try + Return dr + End Function + + Public Function P2PMax(LookupField As String, sTable As String, sSearchField As String, sTargetValue As String) As String + If mData Is Nothing Then mData = New Sql + + Dim dr As GridcoinReader + Dim sql As String + sql = "Select Max(Cast (" + LookupField + " as money)) from " + sTable + " where deleted=0 " + + Try + dr = mData.GetGridcoinReader(sql) + + Catch ex As Exception + Return -1 + End Try + + Try + Dim grr As New GridcoinReader.GridcoinRow + grr = dr.GetRow(1) + + Return grr.Values(0).ToString() + + Catch ex As Exception + Log("HEINOUS 2:" + ex.Message) + Return "" + End Try End Function + Public Function P2PValue(LookupField As String, sTable As String, sSearchField As String, sTargetValue As String) As String + If mData Is Nothing Then mData = New Sql + Dim dr As GridcoinReader + Dim sql As String + sql = "Select " + LookupField + " from " + sTable + " where deleted=0 and " + sSearchField + " ='" + sTargetValue + "'" + Log("Tracking " + sql) + + Try + dr = mData.GetGridcoinReader(sql) + + Catch ex As Exception + Return -1 + End Try + + Try + Dim grr As New GridcoinReader.GridcoinRow + grr = dr.GetRow(1) + + Return grr.Values(0).ToString() + + Catch ex As Exception + Log("HEINOUS 2:" + ex.Message) + Return "" + End Try + + End Function Public bSqlHouseCleaningComplete As Boolean = False Public vProj() As String diff --git a/contrib/Installer/boinc/boinc/modGRC.vb b/contrib/Installer/boinc/boinc/modGRC.vb index 515dd08855..0def15ffcc 100644 --- a/contrib/Installer/boinc/boinc/modGRC.vb +++ b/contrib/Installer/boinc/boinc/modGRC.vb @@ -15,6 +15,9 @@ Module modGRC Public mfrmProjects As frmProjects Public mfrmSql As frmSQL + Public mfrmTicketAdd As frmTicketAdd + Public mfrmTicketList As frmTicketList + Public mfrmTicker As frmLiveTicker diff --git a/src/clientversion.h b/src/clientversion.h index 4a6161a834..f10b0b257e 100644 --- a/src/clientversion.h +++ b/src/clientversion.h @@ -9,7 +9,7 @@ #define CLIENT_VERSION_MAJOR 3 #define CLIENT_VERSION_MINOR 3 #define CLIENT_VERSION_REVISION 5 -#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! diff --git a/src/kernel.cpp b/src/kernel.cpp index 76264bfbe6..57fe6e0084 100644 --- a/src/kernel.cpp +++ b/src/kernel.cpp @@ -806,17 +806,8 @@ static bool CheckStakeKernelHashV3(CBlockIndex* pindexPrev, unsigned int nBits, int64_t RSA_WEIGHT = GetRSAWeightByBlock(boincblock); int oNC = 0; double coin_age = std::abs((double)nTimeTx-(double)txPrev.nTime); - double BitsAge = PORDiff * 144; //For every 100 Diff in Bits, two hours of coin age for researchers - if ((payment_age > 60*60) && (payment_age > BitsAge) - && boincblock.Magnitude > 1 - && boincblock.cpid != "INVESTOR" && (coin_age > 4*60*60) && (coin_age > RSA_WEIGHT) - && (RSA_WEIGHT/14 > MintLimiter(PORDiff,RSA_WEIGHT)) - && IsCPIDValidv2(boincblock,pindexPrev->nHeight) ) - { - //Coins are older than RSA balance - oNC=1; - } + //Halford 1-4-2015 : Explain to the Researcher why they are not staking: if (checking_local && LessVerbose(100)) @@ -844,6 +835,24 @@ static bool CheckStakeKernelHashV3(CBlockIndex* pindexPrev, unsigned int nBits, if (checking_local) msMiningErrors2 = "RRSA: " + RoundToString(RSA_WEIGHT,0); + + if (boincblock.cpid != "INVESTOR") + { + if ((payment_age > 60*60) && (payment_age > BitsAge) + && boincblock.Magnitude > 1 && (coin_age > 4*60*60) && (coin_age > RSA_WEIGHT) + && (RSA_WEIGHT/14 > MintLimiter(PORDiff,RSA_WEIGHT)) + && IsCPIDValidv2(boincblock,pindexPrev->nHeight) ) + { + //Coins are older than RSA balance - Allow hash to dictate outcome + } + else + { + return false; + } + } + + + if (nTimeTx < txPrev.nTime) // Transaction timestamp violation return error("CheckStakeKernelHash() : nTime violation"); diff --git a/src/main.cpp b/src/main.cpp index 2afdd7ac36..5caf0f7a28 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -357,7 +357,7 @@ extern void FlushGridcoinBlockFile(bool fFinalize); std::string Organization = ""; std::string OrganizationKey = ""; - int nGrandfather = 113836; + int nGrandfather = 114175; //GPU Projects: std::string msGPUMiningProject = ""; diff --git a/src/version.h b/src/version.h index ad90ace078..cfefd78f3c 100644 --- a/src/version.h +++ b/src/version.h @@ -24,9 +24,9 @@ extern const std::string CLIENT_DATE; /////////////////////////////////////////////////////////// // network protocol versioning // // // -static const int PROTOCOL_VERSION = 180227; // +static const int PROTOCOL_VERSION = 180228; // // disconnect from peers older than this proto version // -static const int MIN_PEER_PROTO_VERSION = 180227; // +static const int MIN_PEER_PROTO_VERSION = 180228; // /////////////////////////////////////////////////////////// //