diff options
author | MarcoFalke <falke.marco@gmail.com> | 2020-11-12 18:06:00 +0100 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2020-12-16 15:08:27 +0100 |
commit | fa09f97beabafaaeb59fca710760578ff1f2e8d7 (patch) | |
tree | 0d3e5efa8304e08d70466bd8794a80ed9b050629 | |
parent | a023094fc4172bed54b0eff0e1baed8efe8ffec6 (diff) | |
download | bitcoin-fa09f97beabafaaeb59fca710760578ff1f2e8d7.tar.xz |
fuzz: Call SendMessages after ProcessMessage to increase coverage
-rw-r--r-- | src/test/fuzz/process_message.cpp | 4 | ||||
-rw-r--r-- | src/test/fuzz/process_messages.cpp | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/test/fuzz/process_message.cpp b/src/test/fuzz/process_message.cpp index 01de8bdbb5..8a6404f210 100644 --- a/src/test/fuzz/process_message.cpp +++ b/src/test/fuzz/process_message.cpp @@ -75,6 +75,10 @@ void fuzz_target(const std::vector<uint8_t>& buffer, const std::string& LIMIT_TO GetTime<std::chrono::microseconds>(), std::atomic<bool>{false}); } catch (const std::ios_base::failure&) { } + { + LOCK(p2p_node.cs_sendProcessing); + g_setup->m_node.peerman->SendMessages(&p2p_node); + } SyncWithValidationInterfaceQueue(); LOCK2(::cs_main, g_cs_orphans); // See init.cpp for rationale for implicit locking order requirement g_setup->m_node.connman->StopNodes(); diff --git a/src/test/fuzz/process_messages.cpp b/src/test/fuzz/process_messages.cpp index e12e780a18..9012c1ba39 100644 --- a/src/test/fuzz/process_messages.cpp +++ b/src/test/fuzz/process_messages.cpp @@ -79,6 +79,10 @@ FUZZ_TARGET_INIT(process_messages, initialize_process_messages) connman.ProcessMessagesOnce(random_node); } catch (const std::ios_base::failure&) { } + { + LOCK(random_node.cs_sendProcessing); + g_setup->m_node.peerman->SendMessages(&random_node); + } } SyncWithValidationInterfaceQueue(); LOCK2(::cs_main, g_cs_orphans); // See init.cpp for rationale for implicit locking order requirement |