aboutsummaryrefslogtreecommitdiff
path: root/src/net.h
diff options
context:
space:
mode:
authordergoegge <n.goeggi@gmail.com>2023-03-24 15:45:50 +0100
committerdergoegge <n.goeggi@gmail.com>2023-03-27 16:00:02 +0200
commitcd0c8eeb0940790b6ba83786d1c9e362d4dc4829 (patch)
tree6afc0ba7f9602b332307f952a0ee8f5875613d12 /src/net.h
parent860402ef2ed728ef096dda4e65e77d566782209f (diff)
[net] Pass nRecvFloodSize to CNode
Diffstat (limited to 'src/net.h')
-rw-r--r--src/net.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/net.h b/src/net.h
index 80965e390b..9b939aea5c 100644
--- a/src/net.h
+++ b/src/net.h
@@ -350,6 +350,7 @@ struct CNodeOptions
NetPermissionFlags permission_flags = NetPermissionFlags::None;
std::unique_ptr<i2p::sam::Session> i2p_sam_session = nullptr;
bool prefer_evict = false;
+ size_t recv_flood_size{DEFAULT_MAXRECEIVEBUFFER * 1000};
};
/** Information about a peer */
@@ -421,7 +422,7 @@ public:
const ConnectionType m_conn_type;
/** Move all messages from the received queue to the processing queue. */
- void MarkReceivedMsgsForProcessing(unsigned int recv_flood_size)
+ void MarkReceivedMsgsForProcessing()
EXCLUSIVE_LOCKS_REQUIRED(!m_msg_process_queue_mutex);
/** Poll the next message from the processing queue of this connection.
@@ -429,7 +430,7 @@ public:
* Returns std::nullopt if the processing queue is empty, or a pair
* consisting of the message and a bool that indicates if the processing
* queue has more entries. */
- std::optional<std::pair<CNetMessage, bool>> PollMessage(size_t recv_flood_size)
+ std::optional<std::pair<CNetMessage, bool>> PollMessage()
EXCLUSIVE_LOCKS_REQUIRED(!m_msg_process_queue_mutex);
/** Account for the total size of a sent message in the per msg type connection stats. */
@@ -621,6 +622,7 @@ private:
const uint64_t nLocalHostNonce;
std::atomic<int> m_greatest_common_version{INIT_PROTO_VERSION};
+ const size_t m_recv_flood_size;
std::list<CNetMessage> vRecvMsg; // Used only by SocketHandler thread
Mutex m_msg_process_queue_mutex;
@@ -883,8 +885,6 @@ public:
/** Get a unique deterministic randomizer. */
CSipHasher GetDeterministicRandomizer(uint64_t id) const;
- unsigned int GetReceiveFloodSize() const;
-
void WakeMessageHandler() EXCLUSIVE_LOCKS_REQUIRED(!mutexMsgProc);
/** Return true if we should disconnect the peer for failing an inactivity check. */