diff options
author | Mission Liao <mission.liao@dexon.org> | 2019-02-20 12:53:18 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-20 12:53:18 +0800 |
commit | 8ef4fc213703620fbfa13890dee042d40eea8545 (patch) | |
tree | ba9a07d2423314396e5677b7294122caa505ae9a /core/utils.go | |
parent | 2cf18fd299ea0fc270b213343314cab652cac271 (diff) | |
download | dexon-consensus-8ef4fc213703620fbfa13890dee042d40eea8545.tar dexon-consensus-8ef4fc213703620fbfa13890dee042d40eea8545.tar.gz dexon-consensus-8ef4fc213703620fbfa13890dee042d40eea8545.tar.bz2 dexon-consensus-8ef4fc213703620fbfa13890dee042d40eea8545.tar.lz dexon-consensus-8ef4fc213703620fbfa13890dee042d40eea8545.tar.xz dexon-consensus-8ef4fc213703620fbfa13890dee042d40eea8545.tar.zst dexon-consensus-8ef4fc213703620fbfa13890dee042d40eea8545.zip |
core: switch round by block height (#450)
Diffstat (limited to 'core/utils.go')
-rw-r--r-- | core/utils.go | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/core/utils.go b/core/utils.go index 14780e7..46aa77a 100644 --- a/core/utils.go +++ b/core/utils.go @@ -21,7 +21,6 @@ import ( "context" "errors" "fmt" - "math/rand" "os" "sort" "time" @@ -130,11 +129,6 @@ func removeFromSortedUint32Slice(xs []uint32, x uint32) []uint32 { return append(xs[:indexToRemove], xs[indexToRemove+1:]...) } -// pickBiasedTime returns a biased time based on a given range. -func pickBiasedTime(base time.Time, biasedRange time.Duration) time.Time { - return base.Add(time.Duration(rand.Intn(int(biasedRange)))) -} - // HashConfigurationBlock returns the hash value of configuration block. func HashConfigurationBlock( notarySet map[types.NodeID]struct{}, @@ -165,8 +159,7 @@ func HashConfigurationBlock( // instance. func VerifyAgreementResult( res *types.AgreementResult, cache *utils.NodeSetCache) error { - notarySet, err := cache.GetNotarySet( - res.Position.Round, res.Position.ChainID) + notarySet, err := cache.GetNotarySet(res.Position.Round) if err != nil { return err } |