From 6efe199cb38eb4cb9a9a64d98ff5f8c4fb997da7 Mon Sep 17 00:00:00 2001 From: Jimmy Hu Date: Wed, 20 Mar 2019 14:57:12 +0800 Subject: core: merge notarySet and DKGSet (#488) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * core: さよăȘら DKGSet * test logger * temporary fix before finalized * core: Sign psig on commit vote * Add syncer log * fixup --- core/utils/nodeset-cache.go | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'core/utils/nodeset-cache.go') diff --git a/core/utils/nodeset-cache.go b/core/utils/nodeset-cache.go index 0090123..89ebd24 100644 --- a/core/utils/nodeset-cache.go +++ b/core/utils/nodeset-cache.go @@ -39,7 +39,6 @@ type sets struct { crs common.Hash nodeSet *types.NodeSet notarySet map[types.NodeID]struct{} - dkgSet map[types.NodeID]struct{} leaderNode map[uint64]types.NodeID } @@ -134,16 +133,6 @@ func (cache *NodeSetCache) GetNotarySet( return cache.cloneMap(IDs.notarySet), nil } -// GetDKGSet returns of DKG set of this round. -func (cache *NodeSetCache) GetDKGSet( - round uint64) (map[types.NodeID]struct{}, error) { - IDs, err := cache.getOrUpdate(round) - if err != nil { - return nil, err - } - return cache.cloneMap(IDs.dkgSet), nil -} - // GetLeaderNode returns the BA leader of the position. func (cache *NodeSetCache) GetLeaderNode(pos types.Position) ( types.NodeID, error) { @@ -254,10 +243,6 @@ func (cache *NodeSetCache) update(round uint64) (nIDs *sets, err error) { notarySet: make(map[types.NodeID]struct{}), leaderNode: make(map[uint64]types.NodeID, cfg.RoundLength), } - if round >= dkgDelayRound { - nIDs.dkgSet = nodeSet.GetSubSet( - int(cfg.DKGSetSize), types.NewDKGSetTarget(crs)) - } nIDs.notarySet = nodeSet.GetSubSet( int(cfg.NotarySetSize), types.NewNotarySetTarget(crs)) cache.rounds[round] = nIDs -- cgit v1.2.3