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:
1 parent
66669da4a5
commit
fa9b5f4fe3
5 files changed
+74
-97
No files matched your search
@@ -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