36 g_setup = testing_setup.get();
51 AddrMan addrman{netgroupman,
true, 0};
56 .reconcile_txs = true,
57 .deterministic_rng = true,
63 std::vector<CNode*> peers;
65 for (
int i = 0; i < num_peers_to_add; ++i) {
68 peerman->InitializeNode(
84 -std::chrono::seconds{10min}.count(),
85 std::chrono::seconds{TIMEOUT_INTERVAL}.count()));
100 }
catch (
const std::ios_base::failure&) {
102 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).
const std::array ALL_NET_MESSAGE_TYPES
All known message types (see above).
ServiceFlags
nServices flags
std::unique_ptr< T > MakeNoLogFileContext(const ChainType chain_type=ChainType::REGTEST, TestOpts opts={})
Make a test setup that has disk access to the debug.log file disabled.
std::vector< unsigned char > data
bool ReceiveMsgFrom(CNode &node, CSerializedNetMsg &&ser_msg) const
void Handshake(CNode &node, bool successfully_connected, ServiceFlags remote_services, ServiceFlags local_services, int32_t version, bool relay_txs) EXCLUSIVE_LOCKS_REQUIRED(NetEventsInterface boo ProcessMessagesOnce)(CNode &node) EXCLUSIVE_LOCKS_REQUIRED(NetEventsInterface
void SetMsgProc(NetEventsInterface *msgproc)
void AddTestNode(CNode &node)
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
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.