diff options
author | Sonic <sonic@cobinhood.com> | 2018-10-14 22:39:11 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2019-04-09 21:32:49 +0800 |
commit | ee4b3e32c5040251b861a23cb8d8ddc41b232ce4 (patch) | |
tree | 38a77a9e61cf7b27141284589fb6e83103e21eef /dex/peer.go | |
parent | 031fe42b08bb576b250a81e1e3885f15910551c5 (diff) | |
download | dexon-ee4b3e32c5040251b861a23cb8d8ddc41b232ce4.tar dexon-ee4b3e32c5040251b861a23cb8d8ddc41b232ce4.tar.gz dexon-ee4b3e32c5040251b861a23cb8d8ddc41b232ce4.tar.bz2 dexon-ee4b3e32c5040251b861a23cb8d8ddc41b232ce4.tar.lz dexon-ee4b3e32c5040251b861a23cb8d8ddc41b232ce4.tar.xz dexon-ee4b3e32c5040251b861a23cb8d8ddc41b232ce4.tar.zst dexon-ee4b3e32c5040251b861a23cb8d8ddc41b232ce4.zip |
dex: add method to get NumChains, NotarySet, DKGSet easily
Diffstat (limited to 'dex/peer.go')
-rw-r--r-- | dex/peer.go | 12 |
1 files changed, 6 insertions, 6 deletions
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 } |