From b9732ec420024d54b6cd487bdef49a21f9ee1dd8 Mon Sep 17 00:00:00 2001 From: yuriy0803 <68668177+yuriy0803@users.noreply.github.com> Date: Mon, 22 Feb 2021 20:52:42 +0100 Subject: [PATCH] Update util.go --- util/util.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/util/util.go b/util/util.go index b4219c5..a75a4b7 100644 --- a/util/util.go +++ b/util/util.go @@ -8,6 +8,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/math" + "github.com/ethereum/go-ethereum/common/hexutil" ) var Ether = math.BigPow(10, 18) @@ -35,7 +36,7 @@ func MakeTimestamp() int64 { func GetTargetHex(diff int64) string { difficulty := big.NewInt(diff) diff1 := new(big.Int).Div(pow256, difficulty) - return string(common.ToHex(diff1.Bytes())) + return string(hexutil.Encode(diff1.Bytes())) } func TargetHexToDiff(targetHex string) *big.Int {