diff --git a/util/util.go b/util/util.go index b261491..0431ef8 100644 --- a/util/util.go +++ b/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 {