Rate limit peer list requests

Send an empty response if the request comes too soon
This commit is contained in:
SChernykh
2023-06-29 18:20:07 +02:00
parent 375bf56e2e
commit e5bf27030d
2 changed files with 31 additions and 39 deletions

View File

@@ -131,8 +131,7 @@ public:
bool m_handshakeInvalid;
int m_listenPort;
uint32_t m_fastPeerListRequestCount;
uint64_t m_prevIncomingPeerListRequest;
uint64_t m_prevPeersSent;
uint64_t m_nextOutgoingPeerListRequest;
std::chrono::high_resolution_clock::time_point m_lastPeerListRequestTime;
int m_peerListPendingRequests;