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:
Cory Fields
2017-10-05 13:35:20 -04:00
committed by Carl Dong
parent 4c0d961eb0
commit 2e56702ece
7 changed files with 15 additions and 18 deletions

View File

@@ -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);