partial bitcoin#24169: Add --enable-c++20 option

includes:
- fae679065e4ef0c6383bbdd1876aaed6c1e40104
This commit is contained in:
Kittywhiskers Van Gogh 2024-06-16 21:14:00 +00:00 committed by pasta
parent 27e885de5f
commit 70485cb2f5
No known key found for this signature in database
GPG Key ID: 52527BEDABE87984
2 changed files with 11 additions and 4 deletions

View File

@ -133,15 +133,22 @@ struct AddedNodeInfo
class CNodeStats; class CNodeStats;
class CClientUIInterface; class CClientUIInterface;
struct CSerializedNetMsg struct CSerializedNetMsg {
{
CSerializedNetMsg() = default; CSerializedNetMsg() = default;
CSerializedNetMsg(CSerializedNetMsg&&) = default; CSerializedNetMsg(CSerializedNetMsg&&) = default;
CSerializedNetMsg& operator=(CSerializedNetMsg&&) = default; CSerializedNetMsg& operator=(CSerializedNetMsg&&) = default;
// No copying, only moves. // No implicit copying, only moves.
CSerializedNetMsg(const CSerializedNetMsg& msg) = delete; CSerializedNetMsg(const CSerializedNetMsg& msg) = delete;
CSerializedNetMsg& operator=(const CSerializedNetMsg&) = 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::vector<unsigned char> data;
std::string m_type; std::string m_type;
}; };

View File

@ -2067,7 +2067,7 @@ void PeerManagerImpl::NewPoWValidBlock(const CBlockIndex *pindex, const std::sha
hashBlock.ToString(), pnode->GetId()); hashBlock.ToString(), pnode->GetId());
const CSerializedNetMsg& ser_cmpctblock{lazy_ser.get()}; 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; state.pindexBestHeaderSent = pindex;
} }
}); });