mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 20:12:57 +01:00
partial bitcoin#24169: Add --enable-c++20 option
includes: - fae679065e4ef0c6383bbdd1876aaed6c1e40104
This commit is contained in:
parent
27e885de5f
commit
70485cb2f5
13
src/net.h
13
src/net.h
@ -133,15 +133,22 @@ struct AddedNodeInfo
|
||||
class CNodeStats;
|
||||
class CClientUIInterface;
|
||||
|
||||
struct CSerializedNetMsg
|
||||
{
|
||||
struct CSerializedNetMsg {
|
||||
CSerializedNetMsg() = default;
|
||||
CSerializedNetMsg(CSerializedNetMsg&&) = default;
|
||||
CSerializedNetMsg& operator=(CSerializedNetMsg&&) = default;
|
||||
// No copying, only moves.
|
||||
// No implicit copying, only moves.
|
||||
CSerializedNetMsg(const CSerializedNetMsg& msg) = delete;
|
||||
CSerializedNetMsg& operator=(const CSerializedNetMsg&) = delete;
|
||||
|
||||
CSerializedNetMsg Copy() const
|
||||
{
|
||||
CSerializedNetMsg copy;
|
||||
copy.data = data;
|
||||
copy.m_type = m_type;
|
||||
return copy;
|
||||
}
|
||||
|
||||
std::vector<unsigned char> data;
|
||||
std::string m_type;
|
||||
};
|
||||
|
@ -2067,7 +2067,7 @@ void PeerManagerImpl::NewPoWValidBlock(const CBlockIndex *pindex, const std::sha
|
||||
hashBlock.ToString(), pnode->GetId());
|
||||
|
||||
const CSerializedNetMsg& ser_cmpctblock{lazy_ser.get()};
|
||||
m_connman.PushMessage(pnode, CSerializedNetMsg{ser_cmpctblock.data, ser_cmpctblock.m_type});
|
||||
m_connman.PushMessage(pnode, ser_cmpctblock.Copy());
|
||||
state.pindexBestHeaderSent = pindex;
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user