mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-27 15:28:49 +02:00
banman: pass the banfile path in
There's no need to hard-code the path here. Passing it in means that there are no ordering concerns wrt establishing the datadir.
This commit is contained in:
@@ -216,7 +216,7 @@ BOOST_AUTO_TEST_CASE(stale_tip_peer_management)
|
||||
|
||||
BOOST_AUTO_TEST_CASE(DoS_banning)
|
||||
{
|
||||
auto banman = MakeUnique<BanMan>(nullptr);
|
||||
auto banman = MakeUnique<BanMan>(GetDataDir() / "banlist.dat", nullptr);
|
||||
auto connman = MakeUnique<CConnman>(0x1337, 0x1337);
|
||||
auto peerLogic = MakeUnique<PeerLogicValidation>(connman.get(), banman.get(), scheduler, false);
|
||||
|
||||
@@ -271,7 +271,7 @@ BOOST_AUTO_TEST_CASE(DoS_banning)
|
||||
|
||||
BOOST_AUTO_TEST_CASE(DoS_banscore)
|
||||
{
|
||||
auto banman = MakeUnique<BanMan>(nullptr);
|
||||
auto banman = MakeUnique<BanMan>(GetDataDir() / "banlist.dat", nullptr);
|
||||
auto connman = MakeUnique<CConnman>(0x1337, 0x1337);
|
||||
auto peerLogic = MakeUnique<PeerLogicValidation>(connman.get(), banman.get(), scheduler, false);
|
||||
|
||||
@@ -318,7 +318,7 @@ BOOST_AUTO_TEST_CASE(DoS_banscore)
|
||||
|
||||
BOOST_AUTO_TEST_CASE(DoS_bantime)
|
||||
{
|
||||
auto banman = MakeUnique<BanMan>(nullptr);
|
||||
auto banman = MakeUnique<BanMan>(GetDataDir() / "banlist.dat", nullptr);
|
||||
auto connman = MakeUnique<CConnman>(0x1337, 0x1337);
|
||||
auto peerLogic = MakeUnique<PeerLogicValidation>(connman.get(), banman.get(), scheduler, false);
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@ TestingSetup::TestingSetup(const std::string& chainName) : BasicTestingSetup(cha
|
||||
for (int i=0; i < nScriptCheckThreads-1; i++)
|
||||
threadGroup.create_thread(&ThreadScriptCheck);
|
||||
|
||||
g_banman = MakeUnique<BanMan>(nullptr);
|
||||
g_banman = MakeUnique<BanMan>(GetDataDir() / "banlist.dat", nullptr);
|
||||
g_connman = MakeUnique<CConnman>(0x1337, 0x1337); // Deterministic randomness for tests.
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user