Skip to content

Commit

Permalink
make hop tags and values private
Browse files Browse the repository at this point in the history
  • Loading branch information
vyzo committed Sep 21, 2021
1 parent 0d8a185 commit 9674b5c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions p2p/protocol/circuitv1/relay/relay.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ const (
ConnectTimeout = 30 * time.Second
HandshakeTimeout = time.Minute

RelayHopTag = "relay-v1-hop"
RelayHopTagValue = 2
relayHopTag = "relay-v1-hop"
relayHopTagValue = 2

maxMessageSize = 4096
)
Expand Down Expand Up @@ -270,7 +270,7 @@ func (r *Relay) addConn(p peer.ID) {
conns++
r.conns[p] = conns
if conns == 1 {
r.host.ConnManager().TagPeer(p, RelayHopTag, RelayHopTagValue)
r.host.ConnManager().TagPeer(p, relayHopTag, relayHopTagValue)
}
}

Expand All @@ -281,7 +281,7 @@ func (r *Relay) rmConn(p peer.ID) {
r.conns[p] = conns
} else {
delete(r.conns, p)
r.host.ConnManager().UntagPeer(p, RelayHopTag)
r.host.ConnManager().UntagPeer(p, relayHopTag)
}
}

Expand Down
8 changes: 4 additions & 4 deletions p2p/protocol/circuitv2/relay/relay.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ const (
ConnectTimeout = 30 * time.Second
HandshakeTimeout = time.Minute

RelayHopTag = "relay-v2-hop"
RelayHopTagValue = 2
relayHopTag = "relay-v2-hop"
relayHopTagValue = 2

maxMessageSize = 4096
)
Expand Down Expand Up @@ -347,7 +347,7 @@ func (r *Relay) addConn(p peer.ID) {
conns++
r.conns[p] = conns
if conns == 1 {
r.host.ConnManager().TagPeer(p, RelayHopTag, RelayHopTagValue)
r.host.ConnManager().TagPeer(p, relayHopTag, relayHopTagValue)
}
}

Expand All @@ -358,7 +358,7 @@ func (r *Relay) rmConn(p peer.ID) {
r.conns[p] = conns
} else {
delete(r.conns, p)
r.host.ConnManager().UntagPeer(p, RelayHopTag)
r.host.ConnManager().UntagPeer(p, relayHopTag)
}
}

Expand Down

0 comments on commit 9674b5c

Please sign in to comment.