aboutsummaryrefslogtreecommitdiff
path: root/src/net.cpp
diff options
context:
space:
mode:
authorPhilip Kaufmann <phil.kaufmann@t-online.de>2015-07-03 10:46:08 +0200
committerPhilip Kaufmann <phil.kaufmann@t-online.de>2015-10-02 11:38:16 +0200
commite8600c924d58f3ef0450fc269998452e5b17aecb (patch)
tree9452c6788867dff22594f3bb230616ea7728828a /src/net.cpp
parent2977c243efc9f122328de1bcfe12364498e0e2b6 (diff)
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
Diffstat (limited to 'src/net.cpp')
-rw-r--r--src/net.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/net.cpp b/src/net.cpp
index 88a8edebc3..15ddaac63d 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -1455,9 +1455,7 @@ void DumpAddresses()
void DumpData()
{
DumpAddresses();
-
- if (CNode::BannedSetIsDirty())
- DumpBanlist();
+ DumpBanlist();
}
void static ProcessOneShot()
@@ -2474,22 +2472,26 @@ bool CBanDB::Read(banmap_t& banSet)
// ... verify the network matches ours
if (memcmp(pchMsgTmp, Params().MessageStart(), sizeof(pchMsgTmp)))
return error("%s: Invalid network magic number", __func__);
-
+
// de-serialize address data into one CAddrMan object
ssBanlist >> banSet;
}
catch (const std::exception& e) {
return error("%s: Deserialize or I/O error - %s", __func__, e.what());
}
-
+
return true;
}
void DumpBanlist()
{
- int64_t nStart = GetTimeMillis();
CNode::SweepBanned(); // clean unused entries (if bantime has expired)
+ if (!CNode::BannedSetIsDirty())
+ return;
+
+ int64_t nStart = GetTimeMillis();
+
CBanDB bandb;
banmap_t banmap;
CNode::GetBanned(banmap);