Skip to content

Commit

Permalink
Node: fixed ResendPeers(). Sending only 5 best non-banned verified peers
Browse files Browse the repository at this point in the history
  • Loading branch information
valdok committed Jan 3, 2019
1 parent fb7c766 commit 202b111
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions node/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1042,10 +1042,18 @@ void Node::Peer::OnResendPeers()
if ((Flags::PiRcvd & m_Flags) && (&pi == m_pInfo))
continue; // skip

if (!pi.m_RawRating.m_Value)
continue; // banned

if (!pi.m_LastSeen)
continue; // recommend only verified peers

proto::PeerInfo msg;
msg.m_ID = pi.m_ID.m_Key;
msg.m_LastAddr = pi.m_Addr.m_Value;
Send(msg);

nRemaining--;
}
}

Expand Down

0 comments on commit 202b111

Please sign in to comment.