Clean up all staticcheck errors (SA4006 + U1000): fix dead assignments in server_info.go and build_universal.go; remove unused proxy fields and functions; delete superseded icon_windows.go and shortcut_windows.go
This commit is contained in:
@@ -66,7 +66,6 @@ type Proxy struct {
|
||||
requestID int
|
||||
loginRequestID int
|
||||
currentJob *Job
|
||||
jobSubscribed bool
|
||||
stopCh chan struct{}
|
||||
wg sync.WaitGroup
|
||||
running bool
|
||||
@@ -844,30 +843,6 @@ func (j *Job) ToModelJob() *models.Job {
|
||||
}
|
||||
}
|
||||
|
||||
// Helper to convert target hex to difficulty
|
||||
func targetToDifficulty(targetHex string) int64 {
|
||||
bytes, err := hex.DecodeString(targetHex)
|
||||
if err != nil || len(bytes) == 0 {
|
||||
return 0
|
||||
}
|
||||
|
||||
// Reverse from little-endian
|
||||
for i, j := 0, len(bytes)-1; i < j; i, j = i+1, j-1 {
|
||||
bytes[i], bytes[j] = bytes[j], bytes[i]
|
||||
}
|
||||
|
||||
target := new(big.Int).SetBytes(bytes)
|
||||
if target.Sign() == 0 {
|
||||
return 0
|
||||
}
|
||||
|
||||
maxTarget := new(big.Int)
|
||||
maxTarget.SetString("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", 16)
|
||||
diff := new(big.Int).Div(maxTarget, target)
|
||||
|
||||
return diff.Int64()
|
||||
}
|
||||
|
||||
// ParseBlob extracts fields from a Monero mining blob
|
||||
func ParseBlob(blobHex string) (map[string]interface{}, error) {
|
||||
blob, err := hex.DecodeString(blobHex)
|
||||
|
||||
Reference in New Issue
Block a user