mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-08 10:31:50 -05:00
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 ```
This commit is contained in:
parent
81e4d54d3a
commit
46b0fe7829
1 changed files with 3 additions and 1 deletions
|
@ -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…
Add table
Reference in a new issue