Skip to content

Commit

Permalink
partial bitcoin#24169: Add --enable-c++20 option
Browse files Browse the repository at this point in the history
includes:
- fae6790
  • Loading branch information
kwvg authored and PastaPastaPasta committed Aug 9, 2024
1 parent 27e885d commit 70485cb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
13 changes: 10 additions & 3 deletions src/net.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand Down
2 changes: 1 addition & 1 deletion src/net_processing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
});
Expand Down

0 comments on commit 70485cb

Please sign in to comment.