0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-03-05 14:06:27 -05:00

Merge #20674: fuzz: Call SendMessages after ProcessMessage to increase coverage

fa09f97bea fuzz: Call SendMessages after ProcessMessage to increase coverage (MarcoFalke)

Pull request description:

ACKs for top commit:
  practicalswift:
    Tested ACK fa09f97bea
  dhruv:
    tACK fa09f97
  Crypt-iQ:
    cr ACK fa09f97bea
  sipa:
    utACK fa09f97bea

Tree-SHA512: 87c52aa38f902c4f6c9c2380f486a3ab21edc0e21e48bb619cdb67cfd698154cc57b170eef31fc940c0bb2c878e155847de03fc6e4cd85bed25f10c4f80c747b
This commit is contained in:
fanquake 2020-12-27 17:37:25 +08:00
commit 31e511658a
No known key found for this signature in database
GPG key ID: 2EEB9F5CC09526C1
2 changed files with 8 additions and 0 deletions

View file

@ -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();

View file

@ -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