diff --git a/src/net.cpp b/src/net.cpp index d76b39f75d5..3e936b5f3de 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -121,10 +121,7 @@ std::string strSubVersion; size_t CSerializedNetMsg::GetMemoryUsage() const noexcept { - // Don't count the dynamic memory used for the m_type string, by assuming it fits in the - // "small string" optimization area (which stores data inside the object itself, up to some - // size; 15 bytes in modern libstdc++). - return sizeof(*this) + memusage::DynamicUsage(data); + return sizeof(*this) + memusage::DynamicUsage(m_type) + memusage::DynamicUsage(data); } void CConnman::AddAddrFetch(const std::string& strDest)