From fae6e31df7c6df04f41fc8401e2a9781a4d75be7 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Mon, 22 Nov 2021 16:06:55 +0100 Subject: refactor: Set fSuccessfullyConnected in FillNode Also, pass ConnmanTestMsg& and PeerManager& (needed for later commits). --- src/test/fuzz/util.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/test/fuzz/util.cpp') diff --git a/src/test/fuzz/util.cpp b/src/test/fuzz/util.cpp index ae5f7a379e..59a76a425b 100644 --- a/src/test/fuzz/util.cpp +++ b/src/test/fuzz/util.cpp @@ -200,16 +200,19 @@ bool FuzzedSock::IsConnected(std::string& errmsg) const return false; } -void FillNode(FuzzedDataProvider& fuzzed_data_provider, CNode& node, bool init_version) noexcept +void FillNode(FuzzedDataProvider& fuzzed_data_provider, ConnmanTestMsg& connman, PeerManager& peerman, CNode& node) noexcept { + const bool successfully_connected{fuzzed_data_provider.ConsumeBool()}; + node.fSuccessfullyConnected = successfully_connected; const ServiceFlags remote_services = ConsumeWeakEnum(fuzzed_data_provider, ALL_SERVICE_FLAGS); const NetPermissionFlags permission_flags = ConsumeWeakEnum(fuzzed_data_provider, ALL_NET_PERMISSION_FLAGS); const int32_t version = fuzzed_data_provider.ConsumeIntegralInRange(MIN_PEER_PROTO_VERSION, std::numeric_limits::max()); const bool filter_txs = fuzzed_data_provider.ConsumeBool(); + node.fPauseSend = false; node.nServices = remote_services; node.m_permissionFlags = permission_flags; - if (init_version) { + if (successfully_connected) { node.nVersion = version; node.SetCommonVersion(std::min(version, PROTOCOL_VERSION)); } -- cgit v1.2.3