18#include <util/threadinterrupt.h>
22 static const auto testing_setup = MakeNoLogFileContext<>();
40 const Proxy sam_proxy{addr,
false};
46 if (session.Listen(conn)) {
47 if (session.Accept(conn)) {
50 }
catch (
const std::runtime_error&) {
57 if (session.Connect(
CService{}, conn, proxy_error)) {
59 conn.
sock->SendComplete(
"verack\n", 10ms, *interrupt);
60 }
catch (
const std::runtime_error&) {
64 fs::remove(private_key_path);
fs::path GetDataDirNet() const EXCLUSIVE_LOCKS_REQUIRED(!cs_args)
Get data directory path with appended network identifier.
A combination of a network address (CNetAddr) and a (TCP) port.
Helper to initialize the global NodeClock, let a duration elapse, and reset it after use in a test.
#define COMPAT_IN6ADDR_LOOPBACK_INIT
static constexpr size_t MAX_MSG_SIZE
The maximum size of an incoming message from the I2P SAM proxy (in bytes).
std::function< std::unique_ptr< Sock >(int, int, int)> CreateSock
Socket factory.
An established connection with another peer.
std::unique_ptr< Sock > sock
Connected socket.
FUZZ_TARGET(i2p,.init=initialize_i2p)
std::shared_ptr< CThreadInterrupt > ConsumeThreadInterrupt(FuzzedDataProvider &fuzzed_data_provider)
NodeSeconds ConsumeTime(FuzzedDataProvider &fuzzed_data_provider, const std::optional< int64_t > &min, const std::optional< int64_t > &max) 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.
FuzzedDataProvider & fuzzed_data_provider