[addrman] Merge the two Add() functions

Merge the two definitions of this overloaded function to reduce code
duplication.
This commit is contained in:
Amiti Uttarwar
2021-07-22 17:00:36 -07:00
parent 3facf0a8ae
commit 60e0cbdd57
5 changed files with 42 additions and 68 deletions

View File

@ -252,13 +252,6 @@ FUZZ_TARGET_INIT(addrman, initialize_addrman)
[&] {
(void)addr_man.SelectTriedCollision();
},
[&] {
const std::optional<CAddress> opt_address = ConsumeDeserializable<CAddress>(fuzzed_data_provider);
const std::optional<CNetAddr> opt_net_addr = ConsumeDeserializable<CNetAddr>(fuzzed_data_provider);
if (opt_address && opt_net_addr) {
addr_man.Add(*opt_address, *opt_net_addr, fuzzed_data_provider.ConsumeIntegralInRange<int64_t>(0, 100000000));
}
},
[&] {
std::vector<CAddress> addresses;
while (fuzzed_data_provider.ConsumeBool()) {