34 static const auto testing_setup = MakeNoLogFileContext<const TestingSetup>(
36 g_setup = testing_setup.get();
52 AddrMan addrman{netgroupman,
true, 0};
57 .reconcile_txs = true,
58 .deterministic_rng = true,
64 std::vector<CNode*> peers;
66 for (
int i = 0; i < num_peers_to_add; ++i) {
69 peerman->InitializeNode(
85 -std::chrono::seconds{10min}.count(),
86 std::chrono::seconds{TIMEOUT_INTERVAL}.count()));
101 }
catch (
const std::ios_base::failure&) {
103 peerman->SendMessages(&connection);
Stochastic address manager.
Information about a peer.
std::atomic_bool fSuccessfullyConnected
fSuccessfullyConnected is set to true on receiving VERACK from the peer.
std::atomic_bool fPauseSend
std::atomic_bool fDisconnect
T ConsumeIntegralInRange(T min, T max)
static Mutex g_msgproc_mutex
Mutex for anything that is only accessed via the msg processing thread.
static std::unique_ptr< PeerManager > make(CConnman &connman, AddrMan &addrman, BanMan *banman, ChainstateManager &chainman, CTxMemPool &pool, node::Warnings &warnings, Options opts)
Manages warning messages within a node.
#define LIMITED_WHILE(condition, limit)
Can be used to limit a theoretically unbounded loop.
static const unsigned int MAX_PROTOCOL_MESSAGE_LENGTH
Maximum length of incoming protocol messages (no message over 4 MB is currently acceptable).
FUZZ_TARGET(p2p_handshake,.init=::initialize)
const std::array ALL_NET_MESSAGE_TYPES
All known message types (see above).
ServiceFlags
nServices flags
std::vector< unsigned char > data
bool ReceiveMsgFrom(CNode &node, CSerializedNetMsg &&ser_msg) const
void SetMsgProc(NetEventsInterface *msgproc)
void AddTestNode(CNode &node)
void Handshake(CNode &node, bool successfully_connected, ServiceFlags remote_services, ServiceFlags local_services, int32_t version, bool relay_txs) EXCLUSIVE_LOCKS_REQUIRED(NetEventsInterface bool ProcessMessagesOnce(CNode &node) EXCLUSIVE_LOCKS_REQUIRED(NetEventsInterface
void FlushSendBuffer(CNode &node) const
Testing setup that configures a complete environment.
std::unique_ptr< CConnman > connman
std::unique_ptr< CTxMemPool > mempool
std::unique_ptr< ChainstateManager > chainman
std::unique_ptr< CNode > ConsumeNodeAsUniquePtr(FuzzedDataProvider &fdp, const std::optional< NodeId > &node_id_in=std::nullopt)
auto & PickValue(FuzzedDataProvider &fuzzed_data_provider, Collection &col)
std::vector< B > ConsumeRandomLengthByteVector(FuzzedDataProvider &fuzzed_data_provider, const std::optional< size_t > &max_length=std::nullopt) noexcept
void SeedRandomStateForTest(SeedRand seedtype)
Seed the global RNG state for testing and log the seed value.
@ ZEROS
Seed with a compile time constant of zeros.
int64_t GetTime()
DEPRECATED Use either ClockType::now() or Now<TimePointType>() if a cast is needed.
void SetMockTime(int64_t nMockTimeIn)
DEPRECATED Use SetMockTime with chrono type.