diff options
author | MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> | 2023-11-16 15:43:15 +0100 |
---|---|---|
committer | MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> | 2023-11-20 14:02:27 +0100 |
commit | fa9b5f4fe32c0cfe2e477bb11912756f84a52cfe (patch) | |
tree | 8ccbe9e0ce69517c779848ef9e085cbafa9c32a6 /src/test/net_tests.cpp | |
parent | 66669da4a5ca9edf2a40d20879d9a8aaf2b9e2ee (diff) |
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>
Diffstat (limited to 'src/test/net_tests.cpp')
-rw-r--r-- | src/test/net_tests.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/test/net_tests.cpp b/src/test/net_tests.cpp index 48e0706a53..3c9227cfc4 100644 --- a/src/test/net_tests.cpp +++ b/src/test/net_tests.cpp @@ -845,7 +845,6 @@ BOOST_AUTO_TEST_CASE(initial_advertise_from_version_message) const uint64_t services{NODE_NETWORK | NODE_WITNESS}; const int64_t time{0}; - const CNetMsgMaker msg_maker{PROTOCOL_VERSION}; // Force ChainstateManager::IsInitialBlockDownload() to return false. // Otherwise PushAddress() isn't called by PeerManager::ProcessMessage(). @@ -858,13 +857,13 @@ BOOST_AUTO_TEST_CASE(initial_advertise_from_version_message) std::chrono::microseconds time_received_dummy{0}; const auto msg_version = - msg_maker.Make(NetMsgType::VERSION, PROTOCOL_VERSION, services, time, services, CAddress::V1_NETWORK(peer_us)); + NetMsg::Make(NetMsgType::VERSION, PROTOCOL_VERSION, services, time, services, CAddress::V1_NETWORK(peer_us)); CDataStream msg_version_stream{msg_version.data, SER_NETWORK, PROTOCOL_VERSION}; m_node.peerman->ProcessMessage( peer, NetMsgType::VERSION, msg_version_stream, time_received_dummy, interrupt_dummy); - const auto msg_verack = msg_maker.Make(NetMsgType::VERACK); + const auto msg_verack = NetMsg::Make(NetMsgType::VERACK); CDataStream msg_verack_stream{msg_verack.data, SER_NETWORK, PROTOCOL_VERSION}; // Will set peer.fSuccessfullyConnected to true (necessary in SendMessages()). |