From 076530ddb73955f43c766d3d1cbda0be5d2cc182 Mon Sep 17 00:00:00 2001 From: rjl493456442 Date: Sun, 13 Jan 2019 21:50:35 +0800 Subject: [PATCH] consensus/ethash: use single algorithm definition --- consensus/ethash/ethash.go | 5 +---- consensus/ethash/sealer.go | 3 +-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/consensus/ethash/ethash.go b/consensus/ethash/ethash.go index dc3fd5536c..3730d2a40b 100644 --- a/consensus/ethash/ethash.go +++ b/consensus/ethash/ethash.go @@ -43,10 +43,7 @@ import ( "github.com/hashicorp/golang-lru/simplelru" ) -const ( - algorithmName = "ethash" // PoW algorithm name - algorithmVersion = "1.0.0" // Algorithm revision information -) +const algorithmVersion = "ethash/1.0.0" // PoW algorithm version var ErrInvalidDumpMagic = errors.New("invalid dump magic") diff --git a/consensus/ethash/sealer.go b/consensus/ethash/sealer.go index 9ec58a51ff..fc4dd911e0 100644 --- a/consensus/ethash/sealer.go +++ b/consensus/ethash/sealer.go @@ -26,7 +26,6 @@ import ( "math/rand" "net/http" "runtime" - "strings" "sync" "time" @@ -244,7 +243,7 @@ func (ethash *Ethash) remote(notify []string, noverify bool) { currentWork[1] = common.BytesToHash(SeedHash(block.NumberU64())).Hex() currentWork[2] = common.BytesToHash(new(big.Int).Div(two256, block.Difficulty()).Bytes()).Hex() currentWork[3] = hexutil.EncodeBig(block.Number()) - currentWork[4] = strings.Join([]string{algorithmName, algorithmVersion}, "/") + currentWork[4] = algorithmVersion // Trace the seal work fetched by remote sealer. currentBlock = block