From ab1406248db0a66fa26507d1e82a17965f21465f Mon Sep 17 00:00:00 2001 From: Samsonov Date: Tue, 27 Feb 2018 12:30:09 +0300 Subject: [PATCH] simplify code and fix unexpected switch between miners --- Code/Config.ps1 | 2 +- MindMiner.ps1 | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Code/Config.ps1 b/Code/Config.ps1 index 62444107..c0ac447d 100644 --- a/Code/Config.ps1 +++ b/Code/Config.ps1 @@ -46,7 +46,7 @@ class Config : BaseConfig { static [int] $Processors = 0 static [int] $Cores = 0 static [int] $Threads = 0 - static [string] $Version = "v1.07" + static [string] $Version = "v1.08" static [string] $BinLocation = "Bin" static [eMinerType[]] $ActiveTypes static [string[]] $CPUFeatures diff --git a/MindMiner.ps1 b/MindMiner.ps1 index 768ec72c..3b98cff8 100644 --- a/MindMiner.ps1 +++ b/MindMiner.ps1 @@ -190,17 +190,15 @@ while ($true) if (!$exit) { Remove-Variable speed - $bench = $AllMiners | Where-Object { $_.Speed -eq 0 } | Select-Object -First 1 - if ($global:HasConfirm -eq $true -and !$bench) { + if ($global:HasConfirm -and !($AllMiners | Where-Object { $_.Speed -eq 0 } | Select-Object -First 1)) { # reset confirm after all bench $global:HasConfirm = $false } - $FStart = $global:HasConfirm -eq $false -and !$bench -and - ($Summary.TotalTime.Elapsed.TotalSeconds / 100 -gt ($Summary.FeeTime.Elapsed.TotalSeconds + $Config.AverageCurrentHashSpeed / 2)) + $FStart = !$global:HasConfirm -and ($Summary.TotalTime.Elapsed.TotalSeconds / 100 -gt ($Summary.FeeTime.Elapsed.TotalSeconds + 150)) $FChange = $false if ($FStart -or $Summary.FeeCurTime.IsRunning) { - if ($Summary.FeeCurTime.Elapsed.TotalSeconds -gt $Config.AverageCurrentHashSpeed) { + if (!$FStart -and $Summary.FeeCurTime.Elapsed.TotalSeconds -gt 300) { $FChange = $true $Summary.FStop() }