aboutsummaryrefslogtreecommitdiff
path: root/src/test/util/net.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/util/net.h')
-rw-r--r--src/test/util/net.h29
1 files changed, 27 insertions, 2 deletions
diff --git a/src/test/util/net.h b/src/test/util/net.h
index 497292542b..59c4ddb4b1 100644
--- a/src/test/util/net.h
+++ b/src/test/util/net.h
@@ -6,16 +6,30 @@
#define BITCOIN_TEST_UTIL_NET_H
#include <compat/compat.h>
-#include <node/eviction.h>
-#include <netaddress.h>
#include <net.h>
+#include <net_permissions.h>
+#include <net_processing.h>
+#include <netaddress.h>
+#include <node/connection_types.h>
+#include <node/eviction.h>
+#include <sync.h>
#include <util/sock.h>
+#include <algorithm>
#include <array>
#include <cassert>
+#include <chrono>
+#include <cstdint>
#include <cstring>
#include <memory>
#include <string>
+#include <unordered_map>
+#include <vector>
+
+class FastRandomContext;
+
+template <typename C>
+class Span;
struct ConnmanTestMsg : public CConnman {
using CConnman::CConnman;
@@ -25,6 +39,12 @@ struct ConnmanTestMsg : public CConnman {
m_peer_connect_timeout = timeout;
}
+ std::vector<CNode*> TestNodes()
+ {
+ LOCK(m_nodes_mutex);
+ return m_nodes;
+ }
+
void AddTestNode(CNode& node)
{
LOCK(m_nodes_mutex);
@@ -56,6 +76,11 @@ struct ConnmanTestMsg : public CConnman {
bool ReceiveMsgFrom(CNode& node, CSerializedNetMsg&& ser_msg) const;
void FlushSendBuffer(CNode& node) const;
+
+ bool AlreadyConnectedPublic(const CAddress& addr) { return AlreadyConnectedToAddress(addr); };
+
+ CNode* ConnectNodePublic(PeerManager& peerman, const char* pszDest, ConnectionType conn_type)
+ EXCLUSIVE_LOCKS_REQUIRED(!m_unused_i2p_sessions_mutex);
};
constexpr ServiceFlags ALL_SERVICE_FLAGS[]{