Browse Source

Antminer E9 Pro doesn't work properly

Antminer E9 Pro doesn't work properly
master
yuriy0803 3 years ago committed by GitHub
parent
commit
9ed77c4a24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      util/util.go

12
util/util.go

@ -36,17 +36,7 @@ func MakeTimestamp() int64 {
func GetTargetHex(diff int64) string {
difficulty := big.NewInt(diff)
diff1 := new(big.Int).Div(pow256, difficulty)
targetBytes := diff1.Bytes()
// The target bytes should be exactly 32 bytes long.
if len(targetBytes) < 32 {
padding := make([]byte, 32-len(targetBytes))
targetBytes = append(padding, targetBytes...)
}
targetStr := hexutil.Encode(targetBytes)
return targetStr
return string(hexutil.Encode(diff1.Bytes()))
}
func TargetHexToDiff(targetHex string) *big.Int {

Loading…
Cancel
Save