5#include <chainparams.h>
29 static const auto testing_setup = MakeNoLogFileContext<>(
ChainType::MAIN);
38 if (
const auto service_opt =
41 node.SetAddrLocal(*service_opt);
47 node.CloseSocketDisconnect();
51 node.CopyStats(stats);
54 const CNode* add_ref_node =
node.AddRef();
58 if (
node.GetRefCount() > 0) {
65 node.ReceiveMsgBytes(b, complete);
69 (void)
node.GetAddrLocal();
71 (void)
node.GetLocalNonce();
72 const int ref_count =
node.GetRefCount();
74 (void)
node.GetCommonVersion();
77 (void)
node.HasPermission(net_permission_flags);
78 (void)
node.ConnectedThroughNetwork();
100 assert(service.IsRoutable());
Information about a peer.
A combination of a network address (CNetAddr) and a (TCP) port.
T ConsumeIntegralInRange(T min, T max)
Helper to initialize the global NodeClock, let a duration elapse, and reset it after use in a test.
#define LIMITED_WHILE(condition, limit)
Can be used to limit a theoretically unbounded loop.
bool IsLocal(const CService &addr)
check whether a given address is potentially local
void RemoveLocal(const CService &addr)
bool AddLocal(const CService &addr_, int nScore)
CService GetLocalAddress(const CNode &peer)
GlobalMutex g_maplocalhost_mutex
bool SeenLocal(const CService &addr)
vote for a local address
FUZZ_TARGET(net,.init=initialize_net)
CService ConsumeService(FuzzedDataProvider &fuzzed_data_provider) noexcept
auto ConsumeNode(FuzzedDataProvider &fuzzed_data_provider, const std::optional< NodeId > &node_id_in=std::nullopt) noexcept
NodeSeconds ConsumeTime(FuzzedDataProvider &fuzzed_data_provider, const std::optional< int64_t > &min, const std::optional< int64_t > &max) noexcept
WeakEnumType ConsumeWeakEnum(FuzzedDataProvider &fuzzed_data_provider, const WeakEnumType(&all_types)[size]) noexcept
size_t CallOneOf(FuzzedDataProvider &fuzzed_data_provider, Callables... callables)
std::vector< B > ConsumeRandomLengthByteVector(FuzzedDataProvider &fuzzed_data_provider, const std::optional< size_t > &max_length=std::nullopt) noexcept
constexpr NetPermissionFlags ALL_NET_PERMISSION_FLAGS[]
FuzzedDataProvider & fuzzed_data_provider