Megaminer icon indicating copy to clipboard operation
Megaminer copied to clipboard

Miner gets stuck on a coin if the profit is high even if the miner count drops below config value

Open thebeerbaron2018 opened this issue 6 years ago • 2 comments

Forgive me - I am on a mobile device and it's difficult to pull requests / forks.

Please see code change to core.ps1 below for your approval. This extra IF statement checks the poolworkers of the currently active miner are above the required amount specified in the config - if not then it sets the miner to pending cancelled so the code may choose a new miner that has the required number of workers on the pool.

(by the way you have a spelling mistake on line 816 "Iddle" should be "Idle"

Hope this helps

Regards TheBeerBaron

        #look for last round best
            $Candidates = $ActiveMiners | Where-Object {$_.GpuGroup.Id -eq $Type.Id}
            $BestLast = $Candidates.subminers | Where-Object {$_.Status -eq "Running" -or $_.Status -eq 'PendingCancellation'}
            if ($BestLast -ne $null) {
                $ProfitLast=$BestLast.profits
                $BestLastLogMsg=$ActiveMiners[$BestLast.IdF].name+"/"+$ActiveMiners[$BestLast.IdF].Algorithms+'/'+$ActiveMiners[$BestLast.IdF].Coin+" with Power Limit "+[string]$BestLast.PowerLimit+" (id "+[string]$BestLast.IdF+"-"+[string]$BestLast.Id+") for group "+$Type.groupname
                } 
            else {
                    $ProfitLast=0
}
        #look for last round best
            $Candidates = $ActiveMiners | Where-Object {$_.GpuGroup.Id -eq $Type.Id}
            $BestLast = $Candidates.subminers | Where-Object {$_.Status -eq "Running" -or $_.Status -eq 'PendingCancellation'}
            if ($BestLast -ne $null) {
                $ProfitLast=$BestLast.profits
                $BestLastLogMsg=$ActiveMiners[$BestLast.IdF].name+"/"+$ActiveMiners[$BestLast.IdF].Algorithms+'/'+$ActiveMiners[$BestLast.IdF].Coin+" with Power Limit "+[string]$BestLast.PowerLimit+" (id "+[string]$BestLast.IdF+"-"+[string]$BestLast.Id+") for group "+$Type.groupname

                if (($ActiveMiners[$BestLast.IdF].PoolWorkers) -le ($config.MINWORKERS)) {
                    $BestLast.Status='PendingCancellation'
                    Writelog ("Cancelling miner due to low worker count") $LogFile $true
                    }

                } 
            else {
                    $ProfitLast=0
                }

thebeerbaron2018 avatar Apr 27 '18 17:04 thebeerbaron2018

Additional information to demonstrate the problem: Set @@MINWORKERS=100 in the config file Allow the program to start. It will initially select a pool with >100 workers. If that algorithm then reports most profitable but workers drops to 5 the code will remain on this miner/pool/algo combo even though the profit is still recorded as high but there are not enough workers to efficiently find a block. The only time it will switch out of that scenario using the original code is if one of the other algorithms becomes more profitable. I had a situation today where Xevan was showing a profit value 5x anything other combination. Therefore it was stuck for over 5 hours being the only miner on the pool!

thebeerbaron2018 avatar Apr 27 '18 17:04 thebeerbaron2018

Great stuff, will test it, I have seen the same for workers and it is very sensitive with wrong numbers reported as zero workers / miners active yet 200 -2000 is mining on the same pool.

also some algo's or coins need to have a modified decimal spacing in one of the files to correct the wrong Euro / USD 165 for 22mh vs actual $1.65 profit per day. Maybe this decimal edit can help you until a fix is implemented.

Rimplestilhskin avatar May 11 '18 08:05 Rimplestilhskin