mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-03-05 14:06:27 -05:00
refactor: Move code from ctor into private BanMan::LoadBanlist()
Co-authored-by: Anthony Towns <aj@erisian.com.au>
This commit is contained in:
parent
4d0c00dffd
commit
3919059deb
2 changed files with 14 additions and 7 deletions
|
@ -16,6 +16,19 @@
|
|||
BanMan::BanMan(fs::path ban_file, CClientUIInterface* client_interface, int64_t default_ban_time)
|
||||
: m_client_interface(client_interface), m_ban_db(std::move(ban_file)), m_default_ban_time(default_ban_time)
|
||||
{
|
||||
LoadBanlist();
|
||||
DumpBanlist();
|
||||
}
|
||||
|
||||
BanMan::~BanMan()
|
||||
{
|
||||
DumpBanlist();
|
||||
}
|
||||
|
||||
void BanMan::LoadBanlist()
|
||||
{
|
||||
LOCK(m_cs_banned);
|
||||
|
||||
if (m_client_interface) m_client_interface->InitMessage(_("Loading banlist…").translated);
|
||||
|
||||
int64_t n_start = GetTimeMillis();
|
||||
|
@ -29,13 +42,6 @@ BanMan::BanMan(fs::path ban_file, CClientUIInterface* client_interface, int64_t
|
|||
m_banned = {};
|
||||
m_is_dirty = true;
|
||||
}
|
||||
|
||||
DumpBanlist();
|
||||
}
|
||||
|
||||
BanMan::~BanMan()
|
||||
{
|
||||
DumpBanlist();
|
||||
}
|
||||
|
||||
void BanMan::DumpBanlist()
|
||||
|
|
|
@ -80,6 +80,7 @@ public:
|
|||
void DumpBanlist();
|
||||
|
||||
private:
|
||||
void LoadBanlist() EXCLUSIVE_LOCKS_REQUIRED(!m_cs_banned);
|
||||
bool BannedSetIsDirty();
|
||||
//!set the "dirty" flag for the banlist
|
||||
void SetBannedSetDirty(bool dirty = true);
|
||||
|
|
Loading…
Add table
Reference in a new issue