Bug fix: skip sending sync message if the peer is not in our graph

This commit is contained in:
Milos Gajdos 2020-01-14 19:37:50 +00:00
parent dcd925f1e5
commit c67ef7e017
No known key found for this signature in database
GPG Key ID: 8B31058CC55DFD4F

View File

@ -1270,7 +1270,8 @@ func (n *network) manage() {
peers := n.Peers() peers := n.Peers()
// pick a random peer from the list of peers and request full sync // pick a random peer from the list of peers and request full sync
peer := n.node.GetPeerNode(peers[rnd.Intn(len(peers))].Id()) peer := n.node.GetPeerNode(peers[rnd.Intn(len(peers))].Id())
if peer != nil { // skip if we can't find randmly selected peer
if peer == nil {
continue continue
} }