mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-05-16 21:20:43 +02:00
banlist (bugfix): allow CNode::SweepBanned() to run on interval
- allows CNode::SweepBanned() to run, even if !CNode::BannedSetIsDirty(), because if nBanUntil is over we want the ban to be disabled for these nodes
This commit is contained in:
parent
2977c243ef
commit
e8600c924d
10
src/net.cpp
10
src/net.cpp
@ -1455,9 +1455,7 @@ void DumpAddresses()
|
|||||||
void DumpData()
|
void DumpData()
|
||||||
{
|
{
|
||||||
DumpAddresses();
|
DumpAddresses();
|
||||||
|
DumpBanlist();
|
||||||
if (CNode::BannedSetIsDirty())
|
|
||||||
DumpBanlist();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void static ProcessOneShot()
|
void static ProcessOneShot()
|
||||||
@ -2487,9 +2485,13 @@ bool CBanDB::Read(banmap_t& banSet)
|
|||||||
|
|
||||||
void DumpBanlist()
|
void DumpBanlist()
|
||||||
{
|
{
|
||||||
int64_t nStart = GetTimeMillis();
|
|
||||||
CNode::SweepBanned(); // clean unused entries (if bantime has expired)
|
CNode::SweepBanned(); // clean unused entries (if bantime has expired)
|
||||||
|
|
||||||
|
if (!CNode::BannedSetIsDirty())
|
||||||
|
return;
|
||||||
|
|
||||||
|
int64_t nStart = GetTimeMillis();
|
||||||
|
|
||||||
CBanDB bandb;
|
CBanDB bandb;
|
||||||
banmap_t banmap;
|
banmap_t banmap;
|
||||||
CNode::GetBanned(banmap);
|
CNode::GetBanned(banmap);
|
||||||
|
Loading…
Reference in New Issue
Block a user