Skip to content

Commit

Permalink
Revert "Avoid panic when addr does not exist in book (#484)"
Browse files Browse the repository at this point in the history
This reverts commit 955cfde.
  • Loading branch information
Mdaiki0730 authored Nov 8, 2022
1 parent 955cfde commit f3266ee
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions p2p/pex/addrbook.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,12 +229,8 @@ func (a *addrBook) RemoveAddress(addr *p2p.NetAddress) {
func (a *addrBook) IsGood(addr *p2p.NetAddress) bool {
a.mtx.Lock()
defer a.mtx.Unlock()
ka, ok := a.addrLookup[addr.ID]
if !ok || ka == nil {
return false
}

return ka.isOld()
return a.addrLookup[addr.ID].isOld()
}

// IsBanned returns true if the peer is currently banned
Expand Down

0 comments on commit f3266ee

Please sign in to comment.