mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-05 02:33:07 +02:00
net: Use actual memory size in receive buffer accounting
Add a method CNetMessage::GetMemoryUsage and use this for accounting of the size of the process receive queue instead of the raw message size. This ensures that allocation and deserialization overhead is taken into account.
This commit is contained in:
@@ -245,6 +245,9 @@ public:
|
||||
CNetMessage(const CNetMessage&) = delete;
|
||||
CNetMessage& operator=(CNetMessage&&) = default;
|
||||
CNetMessage& operator=(const CNetMessage&) = delete;
|
||||
|
||||
/** Compute total memory usage of this object (own memory + any dynamic memory). */
|
||||
size_t GetMemoryUsage() const noexcept;
|
||||
};
|
||||
|
||||
/** The Transport converts one connection's sent messages to wire bytes, and received bytes back. */
|
||||
|
||||
Reference in New Issue
Block a user