mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-10 20:03:34 -03:00
[net] Delete CNetMessage copy constructor/assignment op
This commit is contained in:
parent
630756cac0
commit
b5a85b365a
1 changed files with 8 additions and 0 deletions
|
@ -236,6 +236,14 @@ public:
|
||||||
std::string m_type;
|
std::string m_type;
|
||||||
|
|
||||||
CNetMessage(CDataStream&& recv_in) : m_recv(std::move(recv_in)) {}
|
CNetMessage(CDataStream&& recv_in) : m_recv(std::move(recv_in)) {}
|
||||||
|
// Only one CNetMessage object will exist for the same message on either
|
||||||
|
// the receive or processing queue. For performance reasons we therefore
|
||||||
|
// delete the copy constructor and assignment operator to avoid the
|
||||||
|
// possibility of copying CNetMessage objects.
|
||||||
|
CNetMessage(CNetMessage&&) = default;
|
||||||
|
CNetMessage(const CNetMessage&) = delete;
|
||||||
|
CNetMessage& operator=(CNetMessage&&) = default;
|
||||||
|
CNetMessage& operator=(const CNetMessage&) = delete;
|
||||||
|
|
||||||
void SetVersion(int nVersionIn)
|
void SetVersion(int nVersionIn)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue