mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-20 23:29:12 +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:
@@ -26,13 +26,12 @@ void ConnmanTestMsg::Handshake(CNode& node,
|
||||
{
|
||||
auto& peerman{static_cast<PeerManager&>(*m_msgproc)};
|
||||
auto& connman{*this};
|
||||
const CNetMsgMaker mm{0};
|
||||
|
||||
peerman.InitializeNode(node, local_services);
|
||||
FlushSendBuffer(node); // Drop the version message added by InitializeNode.
|
||||
|
||||
CSerializedNetMsg msg_version{
|
||||
mm.Make(NetMsgType::VERSION,
|
||||
NetMsg::Make(NetMsgType::VERSION,
|
||||
version, //
|
||||
Using<CustomUintFormatter<8>>(remote_services), //
|
||||
int64_t{}, // dummy time
|
||||
@@ -59,7 +58,7 @@ void ConnmanTestMsg::Handshake(CNode& node,
|
||||
assert(statestats.m_relay_txs == (relay_txs && !node.IsBlockOnlyConn()));
|
||||
assert(statestats.their_services == remote_services);
|
||||
if (successfully_connected) {
|
||||
CSerializedNetMsg msg_verack{mm.Make(NetMsgType::VERACK)};
|
||||
CSerializedNetMsg msg_verack{NetMsg::Make(NetMsgType::VERACK)};
|
||||
(void)connman.ReceiveMsgFrom(node, std::move(msg_verack));
|
||||
node.fPauseSend = false;
|
||||
connman.ProcessMessagesOnce(node);
|
||||
|
||||
Reference in New Issue
Block a user