[addrman] Add deterministic argument to CAddrMan ctor

Removes the need for tests to update nKey and insecure_rand after constructing
a CAddrMan.
This commit is contained in:
John Newbery
2021-07-23 10:48:34 +01:00
parent ee458d84fc
commit fa9710f62c
10 changed files with 31 additions and 43 deletions

View File

@@ -29,7 +29,8 @@ public:
FuzzedDataProvider& m_fuzzed_data_provider;
explicit CAddrManDeterministic(FuzzedDataProvider& fuzzed_data_provider)
: m_fuzzed_data_provider(fuzzed_data_provider)
: CAddrMan(/* deterministic */ true)
, m_fuzzed_data_provider(fuzzed_data_provider)
{
WITH_LOCK(cs, insecure_rand = FastRandomContext{ConsumeUInt256(fuzzed_data_provider)});
if (fuzzed_data_provider.ConsumeBool()) {