From f3266ee83f9721bb3997700a9ae306c4ca8a7860 Mon Sep 17 00:00:00 2001 From: garian <55307968+Mdaiki0730@users.noreply.github.com> Date: Tue, 8 Nov 2022 18:49:37 +0900 Subject: [PATCH] Revert "Avoid panic when addr does not exist in book (#484)" This reverts commit 955cfde2cb55adf2e9b6b9b2f78c6f7680f3c830. --- p2p/pex/addrbook.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/p2p/pex/addrbook.go b/p2p/pex/addrbook.go index 402ddc6bc..a58ba717e 100644 --- a/p2p/pex/addrbook.go +++ b/p2p/pex/addrbook.go @@ -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