Skip to content

Commit

Permalink
6.4.7
Browse files Browse the repository at this point in the history
Changes:
- Changed the names of configurations items to better reflect their purpose:
    ShowPoolColumnBalances - > ShowPoolBalances

Fixes:
- Core: Do not donate multiple times per day
  • Loading branch information
UselessGuru committed Feb 1, 2025
1 parent 95601bb commit d1b0229
Show file tree
Hide file tree
Showing 117 changed files with 885 additions and 578 deletions.
4 changes: 2 additions & 2 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.4.6
Version date: 2025/01/29
Version: 6.4.7
Version date: 2025/02/01
#>

$Name = [String](Get-Item $MyInvocation.MyCommand.Path).BaseName
Expand Down
4 changes: 2 additions & 2 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.4.6
Version date: 2025/01/29
Version: 6.4.7
Version date: 2025/02/01
#>

$Name = [String](Get-Item $MyInvocation.MyCommand.Path).BaseName
Expand Down
4 changes: 2 additions & 2 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.4.6
Version date: 2025/01/29
Version: 6.4.7
Version date: 2025/02/01
#>

$Name = [String](Get-Item $MyInvocation.MyCommand.Path).BaseName
Expand Down
4 changes: 2 additions & 2 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.4.6
Version date: 2025/01/29
Version: 6.4.7
Version date: 2025/02/01
#>

$Name = [String](Get-Item $MyInvocation.MyCommand.Path).BaseName
Expand Down
4 changes: 2 additions & 2 deletions Balances/NiceHash.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.ps1
Version: 6.4.6
Version date: 2025/01/29
Version: 6.4.7
Version date: 2025/02/01
#>

If ($Config.NiceHashWallet) {
Expand Down
4 changes: 2 additions & 2 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.4.6
Version date: 2025/01/29
Version: 6.4.7
Version date: 2025/02/01
#>

$Name = [String](Get-Item $MyInvocation.MyCommand.Path).BaseName
Expand Down
4 changes: 2 additions & 2 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.4.6
Version date: 2025/01/29
Version: 6.4.7
Version date: 2025/02/01
#>

$Name = [String](Get-Item $MyInvocation.MyCommand.Path).BaseName
Expand Down
4 changes: 2 additions & 2 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.4.6
Version date: 2025/01/29
Version: 6.4.7
Version date: 2025/02/01
#>

$Name = [String](Get-Item $MyInvocation.MyCommand.Path).BaseName
Expand Down
6 changes: 3 additions & 3 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.4.6
Version date: 2025/01/29
Version: 6.4.7
Version date: 2025/02/01
#>

using module ..\Includes\Include.psm1
Expand Down Expand Up @@ -124,7 +124,7 @@ While ($PoolConfig = $Config.PoolsConfig.$BrainName) {
If ($Stat = Get-Stat -Name $StatName) {
$Divisor = $PoolConfig.Variant."$PoolVariant".DivisorMultiplier * $AlgoData.$Algo.mbtc_mh_factor
If ($Stat.Day -and $LastPrice -gt 0 -and ($AlgoData.$Algo.estimate_current / $Divisor -lt $Stat.Day / 10 -or $AlgoData.$Algo.estimate_current / $Divisor -gt $Stat.Day * 10)) {
Remove-Stat -Name $StatName
[Void](Remove-Stat -Name $StatName)
$PoolObjects = $PoolObjects.Where({ $_.Name -ne $Algo })
$PlusPrice = $LastPrice
Write-Message -Level Debug "Pool brain '$BrainName': PlusPrice history cleared for $($StatName -replace '_Profit') (stat day price: $($Stat.Day) vs. estimate current price: $($AlgoData.$Algo.estimate_current / $Divisor))"
Expand Down
6 changes: 3 additions & 3 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.4.6
Version date: 2025/01/29
Version: 6.4.7
Version date: 2025/02/01
#>

using module ..\Includes\Include.psm1
Expand Down Expand Up @@ -133,7 +133,7 @@ While ($PoolConfig = $Config.PoolsConfig.$BrainName) {
If ($Stat = Get-Stat -Name $StatName) {
$Divisor = $PoolConfig.Variant."$PoolVariant".DivisorMultiplier * $AlgoData.$Algo.mbtc_mh_factor
If ($Stat.Day -and $LastPrice -gt 0 -and ($AlgoData.$Algo.estimate_current / $Divisor -lt $Stat.Day / 10 -or $AlgoData.$Algo.estimate_current / $Divisor -gt $Stat.Day * 10)) {
Remove-Stat -Name $StatName
[Void](Remove-Stat -Name $StatName)
$PoolObjects = $PoolObjects.Where({ $_.Name -ne $Algo })
$PlusPrice = $LastPrice
Write-Message -Level Debug "Pool brain '$BrainName': PlusPrice history cleared for $($StatName -replace '_Profit') (stat day price: $($Stat.Day) vs. estimate current price: $($AlgoData.$Algo.estimate_current / $Divisor))"
Expand Down
6 changes: 3 additions & 3 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.4.6
Version date: 2025/01/29
Version: 6.4.7
Version date: 2025/02/01
#>

using module ..\Includes\Include.psm1
Expand Down Expand Up @@ -130,7 +130,7 @@ While ($PoolConfig = $Config.PoolsConfig.$BrainName) {
If ($Stat = Get-Stat -Name $StatName) {
$Divisor = $PoolConfig.Variant."$PoolVariant".DivisorMultiplier * $AlgoData.$Algo.mbtc_mh_factor
If ($Stat.Day -and $LastPrice -gt 0 -and ($AlgoData.$Algo.estimate_current / $Divisor -lt $Stat.Day / 10 -or $AlgoData.$Algo.estimate_current / $Divisor -gt $Stat.Day * 10)) {
Remove-Stat -Name $StatName
[Void](Remove-Stat -Name $StatName)
$PoolObjects = $PoolObjects.Where({ $_.Name -ne $Algo })
$PlusPrice = $LastPrice
Write-Message -Level Debug "Pool brain '$BrainName': PlusPrice history cleared for $($StatName -replace '_Profit') (stat day price: $($Stat.Day) vs. estimate current price: $($AlgoData.$Algo.estimate_current / $Divisor))"
Expand Down
22 changes: 9 additions & 13 deletions Brains/ZPool.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\ZPool.ps1
Version: 6.4.6
Version date: 2025/01/29
Version: 6.4.7
Version date: 2025/02/01
#>

using module ..\Includes\Include.psm1
Expand Down Expand Up @@ -77,22 +77,18 @@ While ($PoolConfig = $Config.PoolsConfig.$BrainName) {
$CurrenciesData.PSObject.Properties.Name.Where({ $CurrenciesData.$_.algo -and $CurrenciesData.$_.name -notcontains "Hashtap" }).ForEach(
{
$CurrenciesData.$_ | Add-Member Currency $(If ($CurrenciesData.$_.symbol) { $CurrenciesData.$_.symbol -replace '-.+$' } Else { $_ -replace '-.+$' })
$CurrenciesData.$_ | Add-Member CoinName ([String]$Variables.CoinNames.($CurrenciesData.$_.Currency)) -Force
$CurrenciesData.$_ | Add-Member CoinName ([String]$Variables.CoinNames[$CurrenciesData.$_.Currency]) -Force
$CurrenciesData.$_ | Add-Member conversion_supported ([Boolean]($PoolConfig.Wallets.($CurrenciesData.$_.Currency) -or -not $CurrenciesData.$_.conversion_disabled))

$CurrenciesData.$_.PSObject.Properties.Remove("symbol")
$CurrenciesData.$_.PSObject.Properties.Remove("name")
$CurrenciesArray += $CurrenciesData.$_
$AlgorithmNorm = $CurrenciesData.$_.algo

If ($CurrenciesData.$_.CoinName -and $CurrenciesData.$_.Currency -and -not $Variables.CurrencyAlgorithm[$AlgorithmNorm]) {
Try {
# Add coin name
[Void](Add-CoinName -Algorithm $AlgorithmNorm -Currency $CurrenciesData.$_.Currency -CoinName $CurrenciesData.$_.CoinName)
}
Catch {
}

Try {
# Add coin name
[Void](Add-CoinName -Algorithm $CurrenciesData.$_.algo -Currency $CurrenciesData.$_.Currency -CoinName $CurrenciesData.$_.CoinName)
}
Catch { }
}
)

Expand Down Expand Up @@ -183,7 +179,7 @@ While ($PoolConfig = $Config.PoolsConfig.$BrainName) {
If ($Stat = Get-Stat -Name $StatName) {
$Divisor = $PoolConfig.Variant."$PoolVariant".DivisorMultiplier * $AlgoData.$Algo.mbtc_mh_factor
If ($Stat.Day -and $LastPrice -gt 0 -and ($AlgoData.$Algo.estimate_current / $Divisor -lt $Stat.Day / 10 -or $AlgoData.$Algo.estimate_current / $Divisor -gt $Stat.Day * 10)) {
Remove-Stat -Name $StatName
[Void](Remove-Stat -Name $StatName)
$PoolObjects = $PoolObjects.Where({ $_.Name -ne $Algo })
$PlusPrice = $LastPrice
Write-Message -Level Debug "Pool brain '$BrainName': PlusPrice history cleared for $($StatName -replace '_Profit') (stat day price: $($Stat.Day) vs. estimate current price: $($AlgoData.$Algo.estimate_current / $Divisor))"
Expand Down
37 changes: 22 additions & 15 deletions Brains/ZergPool.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\ZergPool.ps1
Version: 6.4.6
Version date: 2025/01/29
Version: 6.4.7
Version date: 2025/02/01
#>

using module ..\Includes\Include.psm1
Expand Down Expand Up @@ -48,18 +48,21 @@ While ($PoolConfig = $Config.PoolsConfig.$BrainName) {
Try {

Write-Message -Level Debug "Brain '$BrainName': Start loop$(If ($Duration) { " (Previous loop duration: $Duration sec.)" })"

Do {
Try {
$AlgoData = Invoke-RestMethod -Uri "https://zergpool.com/api/status" -Headers @{ "Cache-Control" = "no-cache" } -SkipCertificateCheck -TimeoutSec $PoolConfig.PoolAPItimeout

If (-not $AlgoData) {
$AlgoData = Invoke-RestMethod -Uri "https://zergpool.com/api/status" -Headers @{ "Cache-Control" = "no-cache" } -SkipCertificateCheck -TimeoutSec $PoolConfig.PoolAPItimeout
}
If (-not $CurrenciesData) {
$CurrenciesData = Invoke-RestMethod -Uri "https://zergpool.com/api/currencies" -Headers @{ "Cache-Control" = "no-cache" } -SkipCertificateCheck -TimeoutSec $PoolConfig.PoolAPItimeout
}
$APICallFails = 0
}
Catch {
If ($APICallFails -lt $PoolConfig.PoolAPIAllowedFailureCount) { $APICallFails ++ }
Start-Sleep -Seconds ([Math]::max(60, ($APICallFails * 5 + $PoolConfig.PoolAPIretryInterval)))
}
} While (-not $AlgoData -and $APICallFails -lt $Config.PoolAPIallowedFailureCount)
} While (-not ($AlgoData -and $CurrenciesData) -and $APICallFails -lt $Config.PoolAPIallowedFailureCount)

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

Expand All @@ -82,21 +85,25 @@ While ($PoolConfig = $Config.PoolsConfig.$BrainName) {

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

# Add currency and coin name to database
$CurrenciesData.PSObject.Properties.Name.Where({ $CurrenciesData.$_.name -and $CurrenciesData.$_.symbol}).ForEach(
{
Try {
# Add coin name
[Void](Add-CoinName -Algorithm $CurrenciesData.$_.algo -Currency $CurrenciesData.$_.symbol -CoinName $CurrenciesData.$_.name)
}
Catch { }
}
)

ForEach ($Algo in $AlgoData.PSObject.Properties.Name) {
$AlgorithmNorm = Get-Algorithm $AlgoData.$Algo.algo
$Currency = [String]$AlgoData.$Algo.Currency
If ($AlgoData.$Algo.actual_last24h_shared) { $AlgoData.$Algo.actual_last24h_shared /= 1000 }
$BasePrice = If ($AlgoData.$Algo.actual_last24h_shared) { $AlgoData.$Algo.actual_last24h_shared } Else { $AlgoData.$Algo.estimate_last24h }

# Add currency and coin name to database
If ($AlgoData.$Algo.CoinName) {
Try {
[Void](Add-CoinName -Algorithm $AlgorithmNorm -Currency $Currency -CoinName $AlgoData.$Algo.CoinName)
}
Catch { }
}

# Keep DAG data up to date
If ($AlgorithmNorm -match $Variables.RegexAlgoHasDAG -and $AlgoData.$Algo.height -gt $Variables.DAGdata.Currency.$Currency.BlockHeight) {
$DAGdata = (Get-DAGData -BlockHeight $AlgoData.$Algo.height -Currency $Algo -EpochReserve 2)
Expand Down Expand Up @@ -155,7 +162,7 @@ While ($PoolConfig = $Config.PoolsConfig.$BrainName) {
If ($Stat = Get-Stat -Name $StatName) {
$Divisor = $PoolConfig.Variant."$PoolVariant".DivisorMultiplier * $AlgoData.$Algo.mbtc_mh_factor
If ($Stat.Day -and $LastPrice -gt 0 -and ($AlgoData.$Algo.estimate_current / $Divisor -lt $Stat.Day / 10 -or $AlgoData.$Algo.estimate_current / $Divisor -gt $Stat.Day * 10)) {
Remove-Stat -Name $StatName
[Void](Remove-Stat -Name $StatName)
$PoolObjects = $PoolObjects.Where({ $_.Name -ne $Algo })
$PlusPrice = $LastPrice
Write-Message -Level Debug "Pool brain '$BrainName': PlusPrice history cleared for $($StatName -replace '_Profit') (stat day price: $($Stat.Day) vs. estimate current price: $($AlgoData.$Algo.estimate_current / $Divisor))"
Expand Down
15 changes: 14 additions & 1 deletion Changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,20 @@ Known issues:
- Balance Tracker / Earnings Graph: Date change does not respect local time zone (accumulated data is calculated in UTC time)


Changelog UG-Miner 6.4.6 2025/01/??
Changelog UG-Miner 6.4.7 2025/02/01
===================================

Changes:
- Changed the names of configurations items to better reflect their purpose:
ShowPoolColumnBalances - > ShowPoolBalances



Fixes:
- Core: Do not donate multiple times per day


Changelog UG-Miner 6.4.6 2025/01/29
===================================

Changes:
Expand Down
Loading

0 comments on commit d1b0229

Please sign in to comment.