-
Notifications
You must be signed in to change notification settings - Fork 172
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Gridcoin Research 3.5.6.7/MSI=40.3 Leisure Upgrade - Added gridcoin diagnostics page. To access it from the Menu click Advanced | Diagnostics. This is designed to find problems that would keep a researcher from staking POR blocks. - Syncing: Modified sync approach to detect ghost chains, missing superblocks or out-of-sync-by-age conditions, and now the wallet should recover automatically if it stays out of sync for 30+ minutes. - Cleaned up some old .NET code. - Removed GRCAddress from getpeerinfo
- Loading branch information
Showing
22 changed files
with
1,077 additions
and
181 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 0 additions & 11 deletions
11
...inRDTestHarness/GridcoinRDTestHarness/bin/Debug/GridcoinRDTestHarness.vshost.exe.manifest
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
Imports System.IO | ||
Imports System.Net.Sockets | ||
Imports System.Globalization | ||
|
||
Public Class GRCDiagnostics | ||
|
||
Public Function GetNISTDateTime() As DateTime | ||
Try | ||
|
||
Dim sNISTHOST As String = "time-nw.nist.gov" 'Atomic Clock Time Server in UTC | ||
Dim client = New TcpClient(sNISTHOST, 13) | ||
Dim localDateTime As DateTime | ||
|
||
Using streamReader = New StreamReader(client.GetStream()) | ||
Dim response = streamReader.ReadToEnd() | ||
Dim utcDateTimeString = response.Substring(7, 17) | ||
'57551 16-06-12 16:57:53 50 0 0 353.8 UTC(NIST) | ||
Dim sChopped As String = Mid(response, 7, 100) | ||
sChopped = Replace(sChopped, "(NIST) *", "") | ||
sChopped = Trim(Left(sChopped, 18)) | ||
sChopped += " UTC" | ||
Dim sYear As String = "20" + Mid(sChopped, 1, 2) | ||
Dim sMonth As String = Mid(sChopped, 4, 2) | ||
Dim sDay As String = Mid(sChopped, 7, 2) | ||
Dim sHour As String = Mid(sChopped, 10, 2) | ||
Dim sMinute As String = Mid(sChopped, 13, 2) | ||
Dim sSecond As String = Mid(sChopped, 16, 2) | ||
localDateTime = New Date(Val(sYear), Val(sMonth), Val(sDay), Val(sHour), Val(sMinute), Val(sSecond)) | ||
End Using | ||
Return localDateTime | ||
Catch ex As Exception | ||
Return CDate("1-1-1970") | ||
End Try | ||
End Function | ||
Public Function VerifyPort(lPortNumber As Long, sHost As String) As Boolean | ||
|
||
Try | ||
Dim client = New TcpClient(sHost, lPortNumber) | ||
Using streamReader = New StreamReader(client.GetStream()) | ||
Dim response = streamReader.ReadToEnd() | ||
'Note if we made it this far without an error, the result is positive | ||
Return True | ||
End Using | ||
Return True | ||
Catch ex As Exception | ||
Return False | ||
End Try | ||
End Function | ||
|
||
End Class |
Oops, something went wrong.