angelbbs / NiceHashMinerLegacy

NiceHash Miner Legacy Fork Fix
Other
73 stars 18 forks source link

Exception on program start and program close without closing the miner instances both on internet loss event #150

Open laucip opened 2 years ago

laucip commented 2 years ago

An exception is given after the program restarts when internet connection is lost. Problem occurs also if fresh start is attempted with no internet. The program restarts by itself after a while waiting for the internet connection so this is not critical.

Also sometimes the program closes without closing the miner instances when internet connection is lost. this causes a problem when internet connection recovers because old miner instances continue mining and will interfere with the new ones launched.

Exception text:

System.NullReferenceException: Object reference not set to an instance of an object. at NiceHashMiner.Form_Main.StartMining(Boolean showWarnings) in D:\NiceHashMinerLegacy\NiceHashMinerLegacy\NiceHashMiner\Forms\Form_Main.cs:line 2462 at NiceHashMiner.Form_Main.AutoStartTimer_Tick(Object sender, EventArgs e) in D:\NiceHashMinerLegacy\NiceHashMinerLegacy\NiceHashMiner\Forms\Form_Main.cs:line 1047 at System.Windows.Forms.Timer.OnTick(EventArgs e) at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

************** Loaded Assemblies **************
mscorlib
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4420.0 built by: NET48REL1LAST_C
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll
----------------------------------------
NiceHashMinerLegacy
    Assembly Version: 1.0.8029.25231
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Mining/NHML%20Fork%20Fix/NiceHashMinerLegacy.exe
----------------------------------------
System
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4360.0 built by: NET48REL1LAST_C
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Windows.Forms
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4400.0 built by: NET48REL1LAST_C
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4390.0 built by: NET48REL1LAST_C
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
NiceHashMinerLegacy.Common
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Mining/NHML%20Fork%20Fix/NiceHashMinerLegacy.exe
----------------------------------------
System.Runtime
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4084.0
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Runtime/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Runtime.dll
----------------------------------------
websocket-sharp
    Assembly Version: 1.0.2.21356
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Mining/NHML%20Fork%20Fix/NiceHashMinerLegacy.exe
----------------------------------------
Newtonsoft.Json
    Assembly Version: 10.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Mining/NHML%20Fork%20Fix/NiceHashMinerLegacy.exe
----------------------------------------
System.Configuration
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4190.0 built by: NET48REL1LAST_B
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Core
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4455.0 built by: NET48REL1LAST_C
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Xml
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4084.0 built by: NET48REL1
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Management
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4435.0 built by: NET48REL1LAST_C
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Management/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Management.dll
----------------------------------------
System.Numerics
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4084.0 built by: NET48REL1
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Numerics/v4.0_4.0.0.0__b77a5c561934e089/System.Numerics.dll
----------------------------------------
System.Runtime.Serialization
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4455.0 built by: NET48REL1LAST_C
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.Serialization/v4.0_4.0.0.0__b77a5c561934e089/System.Runtime.Serialization.dll
----------------------------------------
System.Data
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4455.0 built by: NET48REL1LAST_C
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_64/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------
log4net
    Assembly Version: 1.2.15.0
    Win32 Version: 1.2.15.0
    CodeBase: file:///C:/Mining/NHML%20Fork%20Fix/log4net.DLL
----------------------------------------
MessageBoxManager
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Mining/NHML%20Fork%20Fix/NiceHashMinerLegacy.exe
----------------------------------------
OpenHardwareMonitorLib
    Assembly Version: 0.9.6.0
    Win32 Version: 0.9.6.0
    CodeBase: file:///C:/Mining/NHML%20Fork%20Fix/OpenHardwareMonitorLib.DLL
----------------------------------------
NiceHashMinerLegacy.Extensions
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Mining/NHML%20Fork%20Fix/NiceHashMinerLegacy.exe
----------------------------------------
System.Collections
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4084.0
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Collections/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Collections.dll
----------------------------------------
System.Linq
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4084.0
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Linq/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Linq.dll
----------------------------------------
ManagedNvml
    Assembly Version: 8.0.22.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Mining/NHML%20Fork%20Fix/NiceHashMinerLegacy.exe
----------------------------------------
PInvokeDelegateFactoryInternalAssembly
    Assembly Version: 0.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Mining/NHML%20Fork%20Fix/NiceHashMinerLegacy.exe
----------------------------------------
PInvokeDelegateFactoryInternalAssembly
    Assembly Version: 0.0.0.0
    Win32 Version: 0.9.6.0
    CodeBase: file:///C:/Mining/NHML%20Fork%20Fix/OpenHardwareMonitorLib.dll
----------------------------------------
Microsoft.CSharp
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4084.0
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Microsoft.CSharp/v4.0_4.0.0.0__b03f5f7f11d50a3a/Microsoft.CSharp.dll
----------------------------------------
NiceHashMinerLegacy.Divert
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Mining/NHML%20Fork%20Fix/NiceHashMinerLegacy.exe
----------------------------------------
System.Dynamic
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4084.0
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Dynamic/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Dynamic.dll
----------------------------------------
Anonymously Hosted DynamicMethods Assembly
    Assembly Version: 0.0.0.0
    Win32 Version: 4.8.4420.0 built by: NET48REL1LAST_C
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_64/mscorlib/v4.0_4.0.0.0__b77a5c561934e089/mscorlib.dll
----------------------------------------