aboutsummaryrefslogtreecommitdiffstats
path: root/dex/peer.go
diff options
context:
space:
mode:
authorSonic <sonic@cobinhood.com>2018-10-14 22:39:11 +0800
committerWei-Ning Huang <w@dexon.org>2018-12-19 20:54:27 +0800
commitbc4075d5c095ea29f576f546fdeb245a0e00d4ea (patch)
tree4b36b7433d9730638e5ebf2acf22f48650de11e0 /dex/peer.go
parent95379029f2e3eb0ffd2c1a6c151100062cb5d5cc (diff)
downloaddexon-bc4075d5c095ea29f576f546fdeb245a0e00d4ea.tar
dexon-bc4075d5c095ea29f576f546fdeb245a0e00d4ea.tar.gz
dexon-bc4075d5c095ea29f576f546fdeb245a0e00d4ea.tar.bz2
dexon-bc4075d5c095ea29f576f546fdeb245a0e00d4ea.tar.lz
dexon-bc4075d5c095ea29f576f546fdeb245a0e00d4ea.tar.xz
dexon-bc4075d5c095ea29f576f546fdeb245a0e00d4ea.tar.zst
dexon-bc4075d5c095ea29f576f546fdeb245a0e00d4ea.zip
dex: add method to get NumChains, NotarySet, DKGSet easily
Diffstat (limited to 'dex/peer.go')
-rw-r--r--dex/peer.go12
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
}