From 461310e401e3802f7b11ed84759365415c980e7b Mon Sep 17 00:00:00 2001 From: Julian Yap Date: Fri, 20 Dec 2019 22:47:51 -1000 Subject: [PATCH 1/2] Fix golint reported issue --- consensus/ubqhash/consensus.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/consensus/ubqhash/consensus.go b/consensus/ubqhash/consensus.go index 4beefb7952..1207ae3458 100644 --- a/consensus/ubqhash/consensus.go +++ b/consensus/ubqhash/consensus.go @@ -401,10 +401,9 @@ func CalcDifficulty(chain consensus.ChainReader, time uint64, parent *types.Head if parentNumber.Cmp(ubqhashConfig.FluxBlock) < 0 { // (chain consensus.ChainReader, parentNumber, parentDiff *big.Int, parent *types.Header) return calcDifficulty2(chain, parentNumber, parentDiff, parent) - } else { - // (chain consensus.ChainReader, time, parentTime, parentNumber, parentDiff *big.Int, parent *types.Header) - return fluxDifficulty(chain, big.NewInt(int64(time)), big.NewInt(int64(parentTime)), parentNumber, parentDiff, parent) } + // (chain consensus.ChainReader, time, parentTime, parentNumber, parentDiff *big.Int, parent *types.Header) + return fluxDifficulty(chain, big.NewInt(int64(time)), big.NewInt(int64(parentTime)), parentNumber, parentDiff, parent) } // Some weird constants to avoid constant memory allocs for them. From 401b1c86a461053e58e78fc42e0f7a4a6c051085 Mon Sep 17 00:00:00 2001 From: Julian Yap Date: Fri, 20 Dec 2019 22:53:37 -1000 Subject: [PATCH 2/2] Fix golint reported issue --- consensus/ubqhash/ubqhash_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/consensus/ubqhash/ubqhash_test.go b/consensus/ubqhash/ubqhash_test.go index ab5baee321..a77e953321 100644 --- a/consensus/ubqhash/ubqhash_test.go +++ b/consensus/ubqhash/ubqhash_test.go @@ -142,7 +142,7 @@ func TestHashRate(t *testing.T) { } api := &API{ubqhash} - for i := 0; i < len(hashrate); i += 1 { + for i := 0; i < len(hashrate); i++ { if res := api.SubmitHashRate(hashrate[i], ids[i]); !res { t.Error("remote miner submit hashrate failed") }