bug_: add more nil checking

This commit is contained in:
Andrea Maria Piana 2024-05-31 09:27:59 +01:00
parent d1cb6b0eaa
commit 03308b3b62
1 changed files with 1 additions and 1 deletions

View File

@ -432,7 +432,7 @@ func (pm *PeerManager) AddDiscoveredPeer(p service.PeerData, connectNow bool) {
enr, err := pm.host.Peerstore().(wps.WakuPeerstore).ENR(p.AddrInfo.ID)
// Verifying if the enr record is more recent (DiscV5 and peer exchange can return peers already seen)
if err == nil {
if p.ENR != nil {
if p.ENR != nil && enr != nil && enr.Record() != nil {
if enr.Record().Seq() >= p.ENR.Seq() {
return
}