test: non-addrman unit tests: override-able check ratio

Make it possible to override from the command line (without recompiling)
the addrman check ratio in the common `TestingSetup::m_node::addrman`
(used by all unit tests) instead of hardcoding it to 0:

```
test_bitcoin --run_test="transaction_tests/tx_valid" -- -checkaddrman=1
```
pull/23373/head
Vasil Dimov 3 years ago
parent 81e4d54d3a
commit 46b0fe7829
No known key found for this signature in database
GPG Key ID: 54DF06F64B55CBBF

@ -223,7 +223,9 @@ TestingSetup::TestingSetup(const std::string& chainName, const std::vector<const
throw std::runtime_error(strprintf("ActivateBestChain failed. (%s)", state.ToString()));
}
m_node.addrman = std::make_unique<AddrMan>(/*asmap=*/std::vector<bool>(), /*deterministic=*/false, /*consistency_check_ratio=*/0);
m_node.addrman = std::make_unique<AddrMan>(/*asmap=*/std::vector<bool>(),
/*deterministic=*/false,
m_node.args->GetIntArg("-checkaddrman", 0));
m_node.banman = std::make_unique<BanMan>(m_args.GetDataDirBase() / "banlist", nullptr, DEFAULT_MISBEHAVING_BANTIME);
m_node.connman = std::make_unique<CConnman>(0x1337, 0x1337, *m_node.addrman); // Deterministic randomness for tests.
m_node.peerman = PeerManager::make(chainparams, *m_node.connman, *m_node.addrman,

Loading…
Cancel
Save