From f4d15de52885a472ffb4ae5982662ec3f41ebebc Mon Sep 17 00:00:00 2001 From: Sonic Date: Sun, 14 Oct 2018 22:39:11 +0800 Subject: dex: add method to get NumChains, NotarySet, DKGSet easily --- dex/peer.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'dex/peer.go') diff --git a/dex/peer.go b/dex/peer.go index e7c4f5d53..44f61354c 100644 --- a/dex/peer.go +++ b/dex/peer.go @@ -785,8 +785,8 @@ func (ps *peerSet) BuildNotaryConn(round uint64) { ps.notaryHistory[round] = struct{}{} selfID := ps.srvr.Self().ID.String() - for chainID := uint32(0); chainID < ps.gov.GetChainNum(round); chainID++ { - s := ps.gov.GetNotarySet(chainID, round) + for chainID := uint32(0); chainID < ps.gov.GetNumChains(round); chainID++ { + s := ps.gov.NotarySet(chainID, round) // not in notary set, add group if _, ok := s[selfID]; !ok { @@ -825,8 +825,8 @@ func (ps *peerSet) ForgetNotaryConn(round uint64) { func (ps *peerSet) forgetNotaryConn(round uint64) { selfID := ps.srvr.Self().ID.String() - for chainID := uint32(0); chainID < ps.gov.GetChainNum(round); chainID++ { - s := ps.gov.GetNotarySet(chainID, round) + for chainID := uint32(0); chainID < ps.gov.GetNumChains(round); chainID++ { + s := ps.gov.NotarySet(chainID, round) if _, ok := s[selfID]; !ok { ps.srvr.RemoveGroup(notarySetName(chainID, round)) continue @@ -852,7 +852,7 @@ func (ps *peerSet) BuildDKGConn(round uint64) { ps.lock.Lock() defer ps.lock.Unlock() selfID := ps.srvr.Self().ID.String() - s := ps.gov.GetDKGSet(round) + s := ps.gov.DKGSet(round) if _, ok := s[selfID]; !ok { return } @@ -882,7 +882,7 @@ func (ps *peerSet) ForgetDKGConn(round uint64) { func (ps *peerSet) forgetDKGConn(round uint64) { selfID := ps.srvr.Self().ID.String() - s := ps.gov.GetDKGSet(round) + s := ps.gov.DKGSet(round) if _, ok := s[selfID]; !ok { return } -- cgit v1.2.3