mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 06:28:31 +01:00
refactor: NetMsg::Make() without nVersion
The nVersion field is unused, so remove it. This is also required for future commits. Also, add PushMessage aliases in PeerManagerImpl to make calling code less verbose. Co-Authored-By: Anthony Towns <aj@erisian.com.au>
This commit is contained in:
@@ -9,19 +9,15 @@
|
||||
#include <net.h>
|
||||
#include <serialize.h>
|
||||
|
||||
class CNetMsgMaker
|
||||
{
|
||||
public:
|
||||
explicit CNetMsgMaker(int /*unused*/) {}
|
||||
|
||||
namespace NetMsg {
|
||||
template <typename... Args>
|
||||
CSerializedNetMsg Make(std::string msg_type, Args&&... args) const
|
||||
CSerializedNetMsg Make(std::string msg_type, Args&&... args)
|
||||
{
|
||||
CSerializedNetMsg msg;
|
||||
msg.m_type = std::move(msg_type);
|
||||
VectorWriter{msg.data, 0, std::forward<Args>(args)...};
|
||||
return msg;
|
||||
}
|
||||
};
|
||||
} // namespace NetMsg
|
||||
|
||||
#endif // BITCOIN_NETMESSAGEMAKER_H
|
||||
|
||||
Reference in New Issue
Block a user