Skip to content

Commit

Permalink
v6.0.1
Browse files Browse the repository at this point in the history
Changes:
- Fix typos
- Minimize memory leak
- Minor code optimizations

Enhancements:
- Includes.psm1 / Update-DAGdata: Do not query 'evr.cryptoscope.io' unless needed
- Legacy GUI: Add '[Currency] to miner algorithm columns

Fixes:
- Brains:  No pool data for 'ZergPoolCoins24hr'
- Core: 'UnrealPoolPriceFactor' not excluding NiceHash & MiningPoolHub (their prices are always right)

Miner changes:
- BzMiner-v19.2.1

Web GUI:
- Fix column alignment
- Fix 'm' not added to culumn headers
  • Loading branch information
UselessGuru committed Jan 5, 2024
1 parent 3c371fc commit 9d53a9d
Show file tree
Hide file tree
Showing 120 changed files with 1,878 additions and 2,976 deletions.
11 changes: 7 additions & 4 deletions Balances/HashCryptos.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<#
Product: UG-Miner
File: \Balances\HashCryptos.ps1
Version: 6.0.0
Version date: 2024/01/01
Version: 6.0.1
Version date: 2024/01/05
#>

$Name = (Get-Item $MyInvocation.MyCommand.Path).BaseName
Expand All @@ -46,7 +46,7 @@ While (-not $APIResponse -and $RetryCount -gt 0 -and $Wallet) {

If ($APIResponse.symbol) {
Return [PSCustomObject]@{
DateTime = ([DateTime]::Now).ToUniversalTime()
DateTime = [DateTime]::Now.ToUniversalTime()
Pool = $Name
Currency = $APIResponse.symbol
Wallet = $Wallet
Expand All @@ -64,4 +64,7 @@ While (-not $APIResponse -and $RetryCount -gt 0 -and $Wallet) {
}

$RetryCount--
}
}

$Error.Clear()
[System.GC]::Collect()
11 changes: 7 additions & 4 deletions Balances/HiveON.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<#
Product: UG-Miner
File: \Balances\Hiveon.ps1
Version: 6.0.0
Version date: 2024/01/01
Version: 6.0.1
Version date: 2024/01/05
#>

$Name = (Get-Item $MyInvocation.MyCommand.Path).BaseName
Expand Down Expand Up @@ -48,7 +48,7 @@ $PoolConfig.Wallets.psBase.Keys.Where({ $_ -in @("BTC", "ETC", "RVN") }).ForEach

If ($APIResponse.earningStats) {
[PSCustomObject]@{
DateTime = ([DateTime]::Now).ToUniversalTime()
DateTime = [DateTime]::Now.ToUniversalTime()
Pool = $Name
Currency = $_
Wallet = $Wallet
Expand All @@ -68,4 +68,7 @@ $PoolConfig.Wallets.psBase.Keys.Where({ $_ -in @("BTC", "ETC", "RVN") }).ForEach
$RetryCount--
}
}
)
)

$Error.Clear()
[System.GC]::Collect()
11 changes: 7 additions & 4 deletions Balances/MiningDutch.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<#
Product: UG-Miner
File: \Balances\MiningDutch.ps1
Version: 6.0.0
Version date: 2024/01/01
Version: 6.0.1
Version date: 2024/01/05
#>

$Name = (Get-Item $MyInvocation.MyCommand.Path).BaseName
Expand Down Expand Up @@ -53,7 +53,7 @@ While (-not $APIResponse -and $RetryCount -gt 0 -and $Config.MiningDutchAPIKey)
}

[PSCustomObject]@{
DateTime = ([DateTime]::Now).ToUniversalTime()
DateTime = [DateTime]::Now.ToUniversalTime()
Pool = $Name
Currency = $Currency
Wallet = $Config.MiningDutchUserName
Expand All @@ -78,4 +78,7 @@ While (-not $APIResponse -and $RetryCount -gt 0 -and $Config.MiningDutchAPIKey)
}

$RetryCount--
}
}

$Error.Clear()
[System.GC]::Collect()
11 changes: 7 additions & 4 deletions Balances/MiningPoolHub.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<#
Product: UG-Miner
File: \Balances\MiningPoolHub.ps1
Version: 6.0.0
Version date: 2024/01/01
Version: 6.0.1
Version date: 2024/01/05
#>

$Name = (Get-Item $MyInvocation.MyCommand.Path).BaseName
Expand Down Expand Up @@ -114,7 +114,7 @@ While (-not $UserAllBalances -and $RetryCount -gt 0 -and $Config.MiningPoolHubAP
If (-not $PayoutThreshold) { $PayoutThreshold = $PoolInfo.min_ap_threshold }

[PSCustomObject]@{
DateTime = ([DateTime]::Now).ToUniversalTime()
DateTime = [DateTime]::Now.ToUniversalTime()
Pool = $Name
Currency = $Currency
Wallet = $Config.MiningPoolHubUserName
Expand All @@ -136,4 +136,7 @@ While (-not $UserAllBalances -and $RetryCount -gt 0 -and $Config.MiningPoolHubAP
}

$RetryCount--
}
}

$Error.Clear()
[System.GC]::Collect()
11 changes: 7 additions & 4 deletions Balances/NiceHash External.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<#
Product: UG-Miner
File: \Balances\NiceHash Internal.ps1
Version: 6.0.0
Version date: 2024/01/01
Version: 6.0.1
Version date: 2024/01/05
#>

$Name = (Get-Item $MyInvocation.MyCommand.Path).BaseName
Expand All @@ -44,7 +44,7 @@ While (-not $APIResponse -and $RetryCount -gt 0 -and $Wallet) {

If ($Sum = [Double]$APIResponse.unpaidAmount + [Double]$APIResponse.externalBalance) {
Return [PSCustomObject]@{
DateTime = ([DateTime]::Now).ToUniversalTime()
DateTime = [DateTime]::Now.ToUniversalTime()
Pool = $Name
Currency = $PayoutCurrency
Wallet = $Wallet
Expand All @@ -65,4 +65,7 @@ While (-not $APIResponse -and $RetryCount -gt 0 -and $Wallet) {
}

$RetryCount--
}
}

$Error.Clear()
[System.GC]::Collect()
11 changes: 7 additions & 4 deletions Balances/NiceHash Internal.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<#
Product: UG-Miner
File: \Balances\NiceHash Internal.ps1
Version: 6.0.0
Version date: 2024/01/01
Version: 6.0.1
Version date: 2024/01/05
#>

$Name = (Get-Item $MyInvocation.MyCommand.Path).BaseName
Expand Down Expand Up @@ -82,7 +82,7 @@ While (-not $APIResponse -and $RetryCount -gt 0 -and $Config.NiceHashAPIKey -and

If ($APIResponse.active) {
Return [PSCustomObject]@{
DateTime = ([DateTime]::Now).ToUniversalTime()
DateTime = [DateTime]::Now.ToUniversalTime()
Pool = $Name
Currency = $PayoutCurrency
Wallet = $Wallet
Expand All @@ -103,4 +103,7 @@ While (-not $APIResponse -and $RetryCount -gt 0 -and $Config.NiceHashAPIKey -and
}

$RetryCount--
}
}

$Error.Clear()
[System.GC]::Collect()
11 changes: 7 additions & 4 deletions Balances/ProHashing.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<#
Product: UG-Miner
File: \Balances\ProHashing.ps1
Version: 6.0.0
Version date: 2024/01/01
Version: 6.0.1
Version date: 2024/01/05
#>

$Name = (Get-Item $MyInvocation.MyCommand.Path).BaseName
Expand All @@ -46,7 +46,7 @@ While (-not $APIResponse -and $RetryCount -gt 0 -and $Config.ProHashingAPIKey) {
($APIResponse.data.balances | Get-Member -MemberType NoteProperty).Name.ForEach(
{
[PSCustomObject]@{
DateTime = ([DateTime]::Now).ToUniversalTime()
DateTime = [DateTime]::Now.ToUniversalTime()
Pool = $Name
Currency = $APIResponse.data.balances.$_.abbreviation
Wallet = $Config.ProHashingUserName
Expand All @@ -72,4 +72,7 @@ While (-not $APIResponse -and $RetryCount -gt 0 -and $Config.ProHashingAPIKey) {
}

$RetryCount--
}
}

$Error.Clear()
[System.GC]::Collect()
11 changes: 7 additions & 4 deletions Balances/ZergPool.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<#
Product: UG-Miner
File: \Balances\ZergPool.ps1
Version: 6.0.0
Version date: 2024/01/01
Version: 6.0.1
Version date: 2024/01/05
#>

$Name = (Get-Item $MyInvocation.MyCommand.Path).BaseName
Expand Down Expand Up @@ -47,7 +47,7 @@ $Config.PoolsConfig.$Name.Wallets.Keys.ForEach(

If ($APIResponse.currency -and ($APIResponse.Unsold -or $APIResponse.Balance -or $APIResponse.Unpaid)) {
[PSCustomObject]@{
DateTime = ([DateTime]::Now).ToUniversalTime()
DateTime = [DateTime]::Now.ToUniversalTime()
Pool = $Name
Currency = $APIResponse.Currency
Wallet = $Wallet
Expand All @@ -70,4 +70,7 @@ $Config.PoolsConfig.$Name.Wallets.Keys.ForEach(
$RetryCount--
}
}
)
)

$Error.Clear()
[System.GC]::Collect()
11 changes: 7 additions & 4 deletions Balances/Zpool.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<#
Product: UG-Miner
File: \Balances\Zpool.ps1
Version: 6.0.0
Version date: 2024/01/01
Version: 6.0.1
Version date: 2024/01/05
#>

$Name = (Get-Item $MyInvocation.MyCommand.Path).BaseName
Expand All @@ -46,7 +46,7 @@ $Config.PoolsConfig.$Name.Wallets.Keys.ForEach(

If ($APIResponse.currency -ne "INVALID" -and $APIResponse.currency -and ($APIResponse.unsold -or $APIResponse.balance -or $APIResponse.unpaid)) {
[PSCustomObject]@{
DateTime = ([DateTime]::Now).ToUniversalTime()
DateTime = [DateTime]::Now.ToUniversalTime()
Pool = $Name
Currency = $APIResponse.currency
Wallet = $Wallet
Expand All @@ -68,4 +68,7 @@ $Config.PoolsConfig.$Name.Wallets.Keys.ForEach(
$RetryCount--
}
}
)
)

$Error.Clear()
[System.GC]::Collect()
11 changes: 6 additions & 5 deletions Brains/HashCryptos.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<#
Product: UG-Miner
File: \Brains\MiningDutch.ps1
Version: 6.0.0
Version date: 2024/01/01
Version: 6.0.1
Version date: 2024/01/05
#>

using module ..\Includes\Include.psm1
Expand Down Expand Up @@ -62,7 +62,7 @@ While ($PoolConfig = $Config.PoolsConfig.$BrainName) {
}
} While ($AlgoData.PSObject.Properties.Name.Count -lt 2)

$Timestamp = ([DateTime]::Now).ToUniversalTime()
$Timestamp = [DateTime]::Now.ToUniversalTime()

# Change numeric string to numbers, some values are null
$AlgoData = ($AlgoData | ConvertTo-Json) -replace ': "(\d+\.?\d*)"', ': $1' -replace '": null', '": 0' | ConvertFrom-Json
Expand Down Expand Up @@ -131,9 +131,10 @@ While ($PoolConfig = $Config.PoolsConfig.$BrainName) {

Remove-Variable CurrenciesData, Duration -ErrorAction Ignore

While ($Timestamp -ge $Variables.MinerDataCollectedTimeStamp -or (([DateTime]::Now).ToUniversalTime().AddSeconds($DurationsAvg) -le $Variables.EndCycleTime -and ([DateTime]::Now).ToUniversalTime() -lt $Variables.EndCycleTime)) {
While ($Timestamp -ge $Variables.MinerDataCollectedTimeStamp -or (([DateTime]::Now).ToUniversalTime().AddSeconds($DurationsAvg) -le $Variables.EndCycleTime -and [DateTime]::Now.ToUniversalTime() -lt $Variables.EndCycleTime)) {
Start-Sleep -Seconds 1
}

$Error.Clear()
[System.GC]::Collect()
}
12 changes: 5 additions & 7 deletions Brains/MiningDutch.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<#
Product: UG-Miner
File: \Brains\MiningDutch.ps1
Version: 6.0.0
Version date: 2024/01/01
Version: 6.0.1
Version date: 2024/01/05
#>

using module ..\Includes\Include.psm1
Expand Down Expand Up @@ -66,10 +66,7 @@ While ($PoolConfig = $Config.PoolsConfig.$BrainName) {
}
} While (-not $AlgoData -or $AlgoData.message)

$Timestamp = ([DateTime]::Now).ToUniversalTime()

# Change numeric string to numbers, some values are null
# $AlgoData = ($AlgoData | ConvertTo-Json) -replace ': "(\d+\.?\d*)"', ': $1' -replace '": null', '": 0' | ConvertFrom-Json
$Timestamp = [DateTime]::Now.ToUniversalTime()

ForEach ($Algo in $AlgoData.PSObject.Properties.Name) {
$BasePrice = If ($AlgoData.$Algo.actual_last24h) { $AlgoData.$Algo.actual_last24h } Else { $AlgoData.$Algo.estimate_last24h }
Expand Down Expand Up @@ -134,9 +131,10 @@ While ($PoolConfig = $Config.PoolsConfig.$BrainName) {

Remove-Variable CurrenciesData, Duration -ErrorAction Ignore

While ($Timestamp -ge $Variables.MinerDataCollectedTimeStamp -or (([DateTime]::Now).ToUniversalTime().AddSeconds($DurationsAvg) -le $Variables.EndCycleTime -and ([DateTime]::Now).ToUniversalTime() -lt $Variables.EndCycleTime)) {
While ($Timestamp -ge $Variables.MinerDataCollectedTimeStamp -or (([DateTime]::Now).ToUniversalTime().AddSeconds($DurationsAvg) -le $Variables.EndCycleTime -and [DateTime]::Now.ToUniversalTime() -lt $Variables.EndCycleTime)) {
Start-Sleep -Seconds 1
}

$Error.Clear()
[System.GC]::Collect()
}
9 changes: 5 additions & 4 deletions Brains/ProHashing.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<#
Product: UG-Miner
File: \Brains\ProHashing.ps1
Version: 6.0.0
Version date: 2024/01/01
Version: 6.0.1
Version date: 2024/01/05
#>

using module ..\Includes\Include.psm1
Expand Down Expand Up @@ -66,7 +66,7 @@ While ($PoolConfig = $Config.PoolsConfig.$BrainName) {
}
} While (-not ($AlgoData -and $CurrenciesData))

$Timestamp = ([DateTime]::Now).ToUniversalTime()
$Timestamp = [DateTime]::Now.ToUniversalTime()

# Change numeric string to numbers, some values are null
$AlgoData = ($AlgoData | ConvertTo-Json) -replace ': "(\d+\.?\d*)"', ': $1' -replace '": null', '": 0' | ConvertFrom-Json
Expand Down Expand Up @@ -138,9 +138,10 @@ While ($PoolConfig = $Config.PoolsConfig.$BrainName) {

Remove-Variable CurrenciesData, Duration -ErrorAction Ignore

While ($Timestamp -ge $Variables.MinerDataCollectedTimeStamp -or (([DateTime]::Now).ToUniversalTime().AddSeconds($DurationsAvg) -le $Variables.EndCycleTime -and ([DateTime]::Now).ToUniversalTime() -lt $Variables.EndCycleTime)) {
While ($Timestamp -ge $Variables.MinerDataCollectedTimeStamp -or (([DateTime]::Now).ToUniversalTime().AddSeconds($DurationsAvg) -le $Variables.EndCycleTime -and [DateTime]::Now.ToUniversalTime() -lt $Variables.EndCycleTime)) {
Start-Sleep -Seconds 1
}

$Error.Clear()
[System.GC]::Collect()
}
Loading

0 comments on commit 9d53a9d

Please sign in to comment.