P2PServer: refactored BLOCK_NOTIFY logic

- Limit how many block requests can be in flight
- Don't send requests for the same block twice
This commit is contained in:
SChernykh
2023-07-07 11:00:19 +02:00
parent 3e269b49d4
commit d8ecc1174d
7 changed files with 50 additions and 29 deletions
+3
View File
@@ -289,6 +289,9 @@ struct hex_buf
{
FORCEINLINE hex_buf(const uint8_t* data, size_t size) : m_data(data), m_size(size) {}
template<typename T>
explicit FORCEINLINE hex_buf(const T* data) : m_data(reinterpret_cast<const uint8_t*>(data)), m_size(sizeof(T)) {}
const uint8_t* m_data;
size_t m_size;
};