fix: not cache nil node

This commit is contained in:
thinkAfCod 2024-10-16 20:37:15 +08:00 committed by Chen Kai
parent 12182b4afe
commit 81477ca08b

View file

@ -401,7 +401,9 @@ func (p *PortalProtocol) cacheNodeById(id enode.ID, addr *net.UDPAddr) {
go func() { go func() {
if _, ok := p.cachedIds[addr.String()]; !ok { if _, ok := p.cachedIds[addr.String()]; !ok {
n := p.ResolveNodeId(id) n := p.ResolveNodeId(id)
p.cacheNode(n) if n != nil {
p.cacheNode(n)
}
} }
}() }()
} }