Skip to content

Commit aa74d0b

Browse files
vijaydasmpPastaPastaPasta
authored andcommitted
fix: follow-up missing changes from Merge bitcoin#20188: tests: Add fuzzing harness for CConnman
1 parent 796353a commit aa74d0b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/test/fuzz/util.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -310,13 +310,13 @@ auto ConsumeNode(FuzzedDataProvider& fuzzed_data_provider, const std::optional<N
310310
const uint64_t local_host_nonce = fuzzed_data_provider.ConsumeIntegral<uint64_t>();
311311
const CAddress addr_bind = ConsumeAddress(fuzzed_data_provider);
312312
const std::string addr_name = fuzzed_data_provider.ConsumeRandomLengthString(64);
313-
const bool inbound = fuzzed_data_provider.ConsumeBool();
314-
const bool block_relay_only = fuzzed_data_provider.ConsumeBool();
315313

314+
const ConnectionType conn_type = fuzzed_data_provider.PickValueInArray({ConnectionType::INBOUND, ConnectionType::OUTBOUND_FULL_RELAY, ConnectionType::MANUAL, ConnectionType::FEELER, ConnectionType::BLOCK_RELAY, ConnectionType::ADDR_FETCH});
315+
const bool inbound_onion = fuzzed_data_provider.ConsumeBool();
316316
if constexpr (ReturnUniquePtr) {
317-
return std::make_unique<CNode>(node_id, local_services, socket, address, keyed_net_group, local_host_nonce, addr_bind, addr_name, inbound, block_relay_only);
317+
return std::make_unique<CNode>(node_id, local_services, socket, address, keyed_net_group, local_host_nonce, addr_bind, addr_name, conn_type, inbound_onion);
318318
} else {
319-
return CNode{node_id, local_services, socket, address, keyed_net_group, local_host_nonce, addr_bind, addr_name, inbound, block_relay_only};
319+
return CNode{node_id, local_services, socket, address, keyed_net_group, local_host_nonce, addr_bind, addr_name, conn_type, inbound_onion};
320320
}
321321
}
322322
inline std::unique_ptr<CNode> ConsumeNodeAsUniquePtr(FuzzedDataProvider& fdp, const std::optional<NodeId>& node_id_in = std::nullopt) { return ConsumeNode<true>(fdp, node_id_in); }

0 commit comments

Comments
 (0)