Skip to content

Commit

Permalink
more cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
czarcas7ic committed Jun 24, 2024
1 parent c6d0307 commit 5062431
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 17 deletions.
1 change: 0 additions & 1 deletion p2p/mock/peer.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,3 @@ func (mp *Peer) RemoteAddr() net.Addr { return &net.TCPAddr{IP: mp.ip, Po
func (mp *Peer) CloseConn() error { return nil }
func (mp *Peer) SetRemovalFailed() {}
func (mp *Peer) GetRemovalFailed() bool { return false }
func (mp *Peer) GetRegion() string { return "" }
14 changes: 0 additions & 14 deletions p2p/mocks/peer.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions p2p/pex/addrbook.go
Original file line number Diff line number Diff line change
Expand Up @@ -1071,8 +1071,10 @@ func getRegionFromIP(ip string) (string, error) {
}

var ipInfo ipInfo
json.Unmarshal(body, &ipInfo)
// fmt.Println("ipInfoPeer", ipInfo)
err = json.Unmarshal(body, &ipInfo)
if err != nil {
return "", err
}

if ipInfo.Status != "success" {
return "", fmt.Errorf("failed to get country from IP %s", ip)
Expand Down
1 change: 1 addition & 0 deletions p2p/pex/pex_reactor.go
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,7 @@ func (r *Reactor) ensurePeersCommon(regionAware bool) {
}

if r.book.NeedMoreAddrs() {

// 1) Pick a random peer and ask for more.
peers := r.Switch.Peers().List()
peersCount := len(peers)
Expand Down

0 comments on commit 5062431

Please sign in to comment.