Skip to content

Commit

Permalink
Limit how often endpoint messages can be processed:
Browse files Browse the repository at this point in the history
The peer discovery protocol depends on peers exchanging messages
listing IP addresses for other peers.

Under normal circumstances, these messages should not be sent
frequently; the existing code would track the earliest time a
new message should be processed, but did not actually enforce
that limit.
  • Loading branch information
nbougalis committed Jul 18, 2022
1 parent 5e6728d commit 47ccd0b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/ripple/peerfinder/impl/Logic.h
Original file line number Diff line number Diff line change
Expand Up @@ -782,10 +782,14 @@ class Logic
// Must be handshaked!
assert(slot->state() == Slot::active);

preprocess(slot, list);

clock_type::time_point const now(m_clock.now());

// Limit how often we accept new endpoints
if (slot->whenAcceptEndpoints > now)
return;

preprocess(slot, list);

for (auto const& ep : list)
{
assert(ep.hops != 0);
Expand Down

0 comments on commit 47ccd0b

Please sign in to comment.