diff options
author | MacroFake <falke.marco@gmail.com> | 2022-07-11 18:07:53 +0200 |
---|---|---|
committer | MacroFake <falke.marco@gmail.com> | 2022-07-12 08:41:34 +0200 |
commit | fa4be8e7c324835d3b9eecb5a3825a4c8f77fb2f (patch) | |
tree | 896019706a601066273aca93f2f4707c9092968d /src/test/fuzz | |
parent | fa7098947ceff1964812d430e769af6d1ad561bd (diff) | |
download | bitcoin-fa4be8e7c324835d3b9eecb5a3825a4c8f77fb2f.tar.xz |
move-only: InitializeNode to handshake helper
Diffstat (limited to 'src/test/fuzz')
-rw-r--r-- | src/test/fuzz/process_message.cpp | 3 | ||||
-rw-r--r-- | src/test/fuzz/process_messages.cpp | 3 | ||||
-rw-r--r-- | src/test/fuzz/util.cpp | 2 | ||||
-rw-r--r-- | src/test/fuzz/util.h | 2 |
4 files changed, 4 insertions, 6 deletions
diff --git a/src/test/fuzz/process_message.cpp b/src/test/fuzz/process_message.cpp index 1763cd8af3..272c9e6cdc 100644 --- a/src/test/fuzz/process_message.cpp +++ b/src/test/fuzz/process_message.cpp @@ -80,8 +80,7 @@ void fuzz_target(FuzzBufferType buffer, const std::string& LIMIT_TO_MESSAGE_TYPE CNode& p2p_node = *ConsumeNodeAsUniquePtr(fuzzed_data_provider).release(); connman.AddTestNode(p2p_node); - g_setup->m_node.peerman->InitializeNode(&p2p_node); - FillNode(fuzzed_data_provider, connman, *g_setup->m_node.peerman, p2p_node); + FillNode(fuzzed_data_provider, connman, p2p_node); const auto mock_time = ConsumeTime(fuzzed_data_provider); SetMockTime(mock_time); diff --git a/src/test/fuzz/process_messages.cpp b/src/test/fuzz/process_messages.cpp index e1c11e1afd..12e682416c 100644 --- a/src/test/fuzz/process_messages.cpp +++ b/src/test/fuzz/process_messages.cpp @@ -46,8 +46,7 @@ FUZZ_TARGET_INIT(process_messages, initialize_process_messages) peers.push_back(ConsumeNodeAsUniquePtr(fuzzed_data_provider, i).release()); CNode& p2p_node = *peers.back(); - g_setup->m_node.peerman->InitializeNode(&p2p_node); - FillNode(fuzzed_data_provider, connman, *g_setup->m_node.peerman, p2p_node); + FillNode(fuzzed_data_provider, connman, p2p_node); connman.AddTestNode(p2p_node); } diff --git a/src/test/fuzz/util.cpp b/src/test/fuzz/util.cpp index 33dcfe95af..f0cff74f94 100644 --- a/src/test/fuzz/util.cpp +++ b/src/test/fuzz/util.cpp @@ -289,7 +289,7 @@ bool FuzzedSock::IsConnected(std::string& errmsg) const return false; } -void FillNode(FuzzedDataProvider& fuzzed_data_provider, ConnmanTestMsg& connman, PeerManager& peerman, CNode& node) noexcept +void FillNode(FuzzedDataProvider& fuzzed_data_provider, ConnmanTestMsg& connman, CNode& node) noexcept { connman.Handshake(node, /*successfully_connected=*/fuzzed_data_provider.ConsumeBool(), diff --git a/src/test/fuzz/util.h b/src/test/fuzz/util.h index 4b89ad9bdc..d189a50a51 100644 --- a/src/test/fuzz/util.h +++ b/src/test/fuzz/util.h @@ -331,7 +331,7 @@ auto ConsumeNode(FuzzedDataProvider& fuzzed_data_provider, const std::optional<N } inline std::unique_ptr<CNode> ConsumeNodeAsUniquePtr(FuzzedDataProvider& fdp, const std::optional<NodeId>& node_id_in = std::nullopt) { return ConsumeNode<true>(fdp, node_id_in); } -void FillNode(FuzzedDataProvider& fuzzed_data_provider, ConnmanTestMsg& connman, PeerManager& peerman, CNode& node) noexcept; +void FillNode(FuzzedDataProvider& fuzzed_data_provider, ConnmanTestMsg& connman, CNode& node) noexcept; class FuzzedFileProvider { |