Merge #21487: fuzz: Use ConsumeWeakEnum in addrman for service flags

55554463c15e3c75a64d26209dd3f8396e508cc2 fuzz: Use ConsumeWeakEnum in addrman for service flags (MarcoFalke)

Pull request description:

  This has minimally better performance. Reported by me in https://github.com/bitcoin/bitcoin/pull/20228#discussion_r598081787

ACKs for top commit:
  practicalswift:
    Tested ACK 55554463c15e3c75a64d26209dd3f8396e508cc2
  vasild:
    ACK 55554463c15e3c75a64d26209dd3f8396e508cc2

Tree-SHA512: 4e5f51fe4f2bd7b2f37d0690e41203341ba45c0c9bc9247449cd26cfb5f77dc2ec61df3e4963276f68694e4b3ca3d0a76367a51c4d775501edeb3224d305a261
This commit is contained in:
MarcoFalke 2021-03-23 09:43:13 +01:00 committed by pasta
parent 01e39a311d
commit d24bd4df90
No known key found for this signature in database
GPG Key ID: 52527BEDABE87984

View File

@ -118,7 +118,7 @@ FUZZ_TARGET_INIT(addrman, initialize_addrman)
[&] {
const std::optional<CService> opt_service = ConsumeDeserializable<CService>(fuzzed_data_provider);
if (opt_service) {
addr_man.SetServices(*opt_service, ServiceFlags{fuzzed_data_provider.ConsumeIntegral<uint64_t>()});
addr_man.SetServices(*opt_service, ConsumeWeakEnum(fuzzed_data_provider, ALL_SERVICE_FLAGS));
}
});
}