mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-03 20:35:17 +02:00
Merge bitcoin/bitcoin#22627: [addrman] De-duplicate Add() function
60e0cbdd57[addrman] Merge the two Add() functions (Amiti Uttarwar) Pull request description: This PR merges the two definitions of this overloaded function to reduce code duplication. When these functions were introduced in5fee401fe1, there were multiple places that invoked `Add()` with a single addr and a vector of addrs each, so it made sense to overload the function. I could see how the small difference in log statement was more meaningful when a peer was added via IRC :) Now, the definition of `Add()` that takes in a single address is only invoked from the hidden/test-only RPC `addpeeraddress`. These changes should not cause any observable difference, and are covered by the existing tests that use this RPC endpoint. ACKs for top commit: jnewbery: Code review ACK60e0cbdd57Zero-1729: crACK60e0cbdfanquake: ACK60e0cbdd57Tree-SHA512: 782fb2ac6d2d403ba7d7ff543197ca42b610b9a8806952d271e57e2ee3527ad1a94af4ebbad5371b5e95d77df07c56ccc8c1d5a2c82cdecb0d2b5085b3bdd5ee
This commit is contained in:
@@ -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()) {
|
||||
|
||||
Reference in New Issue
Block a user