mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-07-05 21:24:47 +02:00
Merge bitcoin/bitcoin#21940: refactor: Mark CAddrMan::Select and GetAddr const
fae108ceb5
Fix incorrect whitespace in addrman (MarcoFalke)fa32024d51
Add missing GUARDED_BY to CAddrMan::insecure_rand (MarcoFalke)fab755b77f
fuzz: Actually use const addrman (MarcoFalke)fae0c79351
refactor: Mark CAddrMan::GetAddr const (MarcoFalke)fa02934c8c
refactor: Mark CAddrMan::Select const (MarcoFalke) Pull request description: To clarify that a call to this only changes the random state and nothing else. ACKs for top commit: jnewbery: Code review ACKfae108ceb5
theStack: re-ACKfae108ceb5
🍦 Tree-SHA512: 3ffb211d4715cc3daeb3bfcdb3fcc6b108ca96df5fa565510436fac0e8da86c93b30c9c4aad0563e27d84f615fcd729481072009a4e2360c8b3d40787ab6506a
This commit is contained in:
@ -27,7 +27,7 @@ class CAddrManDeterministic : public CAddrMan
|
||||
public:
|
||||
void MakeDeterministic(const uint256& random_seed)
|
||||
{
|
||||
insecure_rand = FastRandomContext{random_seed};
|
||||
WITH_LOCK(cs, insecure_rand = FastRandomContext{random_seed});
|
||||
Clear();
|
||||
}
|
||||
};
|
||||
@ -114,11 +114,11 @@ FUZZ_TARGET_INIT(addrman, initialize_addrman)
|
||||
});
|
||||
}
|
||||
const CAddrMan& const_addr_man{addr_man};
|
||||
(void)/*const_*/addr_man.GetAddr(
|
||||
(void)const_addr_man.GetAddr(
|
||||
/* max_addresses */ fuzzed_data_provider.ConsumeIntegralInRange<size_t>(0, 4096),
|
||||
/* max_pct */ fuzzed_data_provider.ConsumeIntegralInRange<size_t>(0, 4096),
|
||||
/* network */ std::nullopt);
|
||||
(void)/*const_*/addr_man.Select(fuzzed_data_provider.ConsumeBool());
|
||||
(void)const_addr_man.Select(fuzzed_data_provider.ConsumeBool());
|
||||
(void)const_addr_man.size();
|
||||
CDataStream data_stream(SER_NETWORK, PROTOCOL_VERSION);
|
||||
data_stream << const_addr_man;
|
||||
|
Reference in New Issue
Block a user