Skip to content

Commit

Permalink
simplify code and fix unexpected switch between miners
Browse files Browse the repository at this point in the history
  • Loading branch information
Quake4 committed Feb 27, 2018
1 parent 6e12961 commit ab14062
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Code/Config.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 3 additions & 5 deletions MindMiner.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down

0 comments on commit ab14062

Please sign in to comment.