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@byzantine-lab.io>2019-06-12 17:23:39 +0800
commitf4d15de52885a472ffb4ae5982662ec3f41ebebc (patch)
tree7ac7bdb3724e63a55930382edfb30d2283ce028b /dex/peer.go
parent2e1556d551420e5f52d6e4e157b46963277eaccd (diff)
downloadgo-tangerine-f4d15de52885a472ffb4ae5982662ec3f41ebebc.tar
go-tangerine-f4d15de52885a472ffb4ae5982662ec3f41ebebc.tar.gz
go-tangerine-f4d15de52885a472ffb4ae5982662ec3f41ebebc.tar.bz2
go-tangerine-f4d15de52885a472ffb4ae5982662ec3f41ebebc.tar.lz
go-tangerine-f4d15de52885a472ffb4ae5982662ec3f41ebebc.tar.xz
go-tangerine-f4d15de52885a472ffb4ae5982662ec3f41ebebc.tar.zst
go-tangerine-f4d15de52885a472ffb4ae5982662ec3f41ebebc.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
}