aboutsummaryrefslogtreecommitdiff
path: root/src/test/fuzz/util.h
diff options
context:
space:
mode:
authorJon Atack <jon@atack.com>2020-12-17 16:33:56 +0100
committerJon Atack <jon@atack.com>2020-12-17 19:56:00 +0100
commit993d1ecd191a7d9161082d4026f020cbf00835bb (patch)
tree61fb760240d31cf7acfec84df4459c856307c05c /src/test/fuzz/util.h
parentb7136c11ab6448142cfcc617babe866e428eeeb4 (diff)
test, fuzz: fix constructing CNode with invalid inbound_onion
as CNode ctor should only be passed inbound_onion = true when the connection is inbound
Diffstat (limited to 'src/test/fuzz/util.h')
-rw-r--r--src/test/fuzz/util.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/test/fuzz/util.h b/src/test/fuzz/util.h
index cf666a8b93..8a2de0f9c9 100644
--- a/src/test/fuzz/util.h
+++ b/src/test/fuzz/util.h
@@ -298,7 +298,7 @@ CNode ConsumeNode(FuzzedDataProvider& fuzzed_data_provider) noexcept
const CAddress addr_bind = ConsumeAddress(fuzzed_data_provider);
const std::string addr_name = fuzzed_data_provider.ConsumeRandomLengthString(64);
const ConnectionType conn_type = fuzzed_data_provider.PickValueInArray({ConnectionType::INBOUND, ConnectionType::OUTBOUND_FULL_RELAY, ConnectionType::MANUAL, ConnectionType::FEELER, ConnectionType::BLOCK_RELAY, ConnectionType::ADDR_FETCH});
- const bool inbound_onion = fuzzed_data_provider.ConsumeBool();
+ const bool inbound_onion{conn_type == ConnectionType::INBOUND ? fuzzed_data_provider.ConsumeBool() : false};
return {node_id, local_services, my_starting_height, socket, address, keyed_net_group, local_host_nonce, addr_bind, addr_name, conn_type, inbound_onion};
}