mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-16 13:01:19 +02:00
net: Use mockable time for ping/pong, add tests
This commit is contained in:
parent
faab4aaf2f
commit
fa3365430c
9 changed files with 166 additions and 34 deletions
|
|
@ -34,7 +34,7 @@ void ProcessMessage(
|
|||
CNode& pfrom,
|
||||
const std::string& msg_type,
|
||||
CDataStream& vRecv,
|
||||
int64_t nTimeReceived,
|
||||
const std::chrono::microseconds time_received,
|
||||
const CChainParams& chainparams,
|
||||
ChainstateManager& chainman,
|
||||
CTxMemPool& mempool,
|
||||
|
|
@ -87,7 +87,7 @@ void test_one_input(const std::vector<uint8_t>& buffer)
|
|||
connman.AddTestNode(p2p_node);
|
||||
g_setup->m_node.peer_logic->InitializeNode(&p2p_node);
|
||||
try {
|
||||
ProcessMessage(p2p_node, random_message_type, random_bytes_data_stream, GetTimeMillis(),
|
||||
ProcessMessage(p2p_node, random_message_type, random_bytes_data_stream, GetTime<std::chrono::microseconds>(),
|
||||
Params(), *g_setup->m_node.chainman, *g_setup->m_node.mempool,
|
||||
g_setup->m_node.connman.get(), g_setup->m_node.banman.get(),
|
||||
std::atomic<bool>{false});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue