mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
ubqhash/consensus: switch out defunct set library for golang-set (set -> mapset)
This commit is contained in:
parent
9ee56d99ac
commit
58ef933d31
1 changed files with 3 additions and 3 deletions
|
|
@ -24,6 +24,7 @@ import (
|
||||||
"runtime"
|
"runtime"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
mapset "github.com/deckarep/golang-set"
|
||||||
"github.com/ubiq/go-ubiq/common"
|
"github.com/ubiq/go-ubiq/common"
|
||||||
"github.com/ubiq/go-ubiq/common/math"
|
"github.com/ubiq/go-ubiq/common/math"
|
||||||
"github.com/ubiq/go-ubiq/consensus"
|
"github.com/ubiq/go-ubiq/consensus"
|
||||||
|
|
@ -32,7 +33,6 @@ import (
|
||||||
"github.com/ubiq/go-ubiq/core/types"
|
"github.com/ubiq/go-ubiq/core/types"
|
||||||
"github.com/ubiq/go-ubiq/log"
|
"github.com/ubiq/go-ubiq/log"
|
||||||
"github.com/ubiq/go-ubiq/params"
|
"github.com/ubiq/go-ubiq/params"
|
||||||
set "gopkg.in/fatih/set.v0"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Ubqhash proof-of-work protocol constants.
|
// Ubqhash proof-of-work protocol constants.
|
||||||
|
|
@ -197,7 +197,7 @@ func (ubqhash *Ubqhash) VerifyUncles(chain consensus.ChainReader, block *types.B
|
||||||
return errTooManyUncles
|
return errTooManyUncles
|
||||||
}
|
}
|
||||||
// Gather the set of past uncles and ancestors
|
// 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()
|
number, parent := block.NumberU64()-1, block.ParentHash()
|
||||||
for i := 0; i < 7; i++ {
|
for i := 0; i < 7; i++ {
|
||||||
|
|
@ -218,7 +218,7 @@ func (ubqhash *Ubqhash) VerifyUncles(chain consensus.ChainReader, block *types.B
|
||||||
for _, uncle := range block.Uncles() {
|
for _, uncle := range block.Uncles() {
|
||||||
// Make sure every uncle is rewarded only once
|
// Make sure every uncle is rewarded only once
|
||||||
hash := uncle.Hash()
|
hash := uncle.Hash()
|
||||||
if uncles.Has(hash) {
|
if uncles.Contains(hash) {
|
||||||
return errDuplicateUncle
|
return errDuplicateUncle
|
||||||
}
|
}
|
||||||
uncles.Add(hash)
|
uncles.Add(hash)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue