aboutsummaryrefslogtreecommitdiffstats
path: root/consensus
diff options
context:
space:
mode:
authorRalph Caraveo III <deckarep@gmail.com>2018-07-16 15:54:19 +0800
committerPéter Szilágyi <peterke@gmail.com>2018-07-16 15:54:19 +0800
commit5d30be412b0f9181cb007c8893ee583ee4319116 (patch)
tree4593b259665d22c552cc869f08317305119a99e0 /consensus
parenteb7f901289dce3f9fe3341da8c0b938ea839f79d (diff)
downloaddexon-5d30be412b0f9181cb007c8893ee583ee4319116.tar
dexon-5d30be412b0f9181cb007c8893ee583ee4319116.tar.gz
dexon-5d30be412b0f9181cb007c8893ee583ee4319116.tar.bz2
dexon-5d30be412b0f9181cb007c8893ee583ee4319116.tar.lz
dexon-5d30be412b0f9181cb007c8893ee583ee4319116.tar.xz
dexon-5d30be412b0f9181cb007c8893ee583ee4319116.tar.zst
dexon-5d30be412b0f9181cb007c8893ee583ee4319116.zip
all: switch out defunct set library to different one (#16873)
* keystore, ethash, eth, miner, rpc, whisperv6: tech debt with now defunct set. * whisperv5: swap out gopkg.in/fatih/set.v0 with supported set
Diffstat (limited to 'consensus')
-rw-r--r--consensus/ethash/consensus.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/consensus/ethash/consensus.go b/consensus/ethash/consensus.go
index bc97dbca4..eb0f73d98 100644
--- a/consensus/ethash/consensus.go
+++ b/consensus/ethash/consensus.go
@@ -24,6 +24,7 @@ import (
"runtime"
"time"
+ mapset "github.com/deckarep/golang-set"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/math"
"github.com/ethereum/go-ethereum/consensus"
@@ -31,7 +32,6 @@ import (
"github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/params"
- set "gopkg.in/fatih/set.v0"
)
// Ethash proof-of-work protocol constants.
@@ -177,7 +177,7 @@ func (ethash *Ethash) VerifyUncles(chain consensus.ChainReader, block *types.Blo
return errTooManyUncles
}
// Gather the set of past uncles and ancestors
- uncles, ancestors := set.New(), make(map[common.Hash]*types.Header)
+ uncles, ancestors := mapset.NewSet(), make(map[common.Hash]*types.Header)
number, parent := block.NumberU64()-1, block.ParentHash()
for i := 0; i < 7; i++ {
@@ -198,7 +198,7 @@ func (ethash *Ethash) VerifyUncles(chain consensus.ChainReader, block *types.Blo
for _, uncle := range block.Uncles() {
// Make sure every uncle is rewarded only once
hash := uncle.Hash()
- if uncles.Has(hash) {
+ if uncles.Contains(hash) {
return errDuplicateUncle
}
uncles.Add(hash)