aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/net.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/net.cpp b/src/net.cpp
index 87c4f0af0a..b13177fe25 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -1455,10 +1455,7 @@ void DumpData()
DumpAddresses();
if (CNode::BannedSetIsDirty())
- {
DumpBanlist();
- CNode::SetBannedSetDirty(false);
- }
}
void static ProcessOneShot()
@@ -2484,14 +2481,14 @@ bool CBanDB::Read(banmap_t& banSet)
void DumpBanlist()
{
int64_t nStart = GetTimeMillis();
-
- CNode::SweepBanned(); //clean unused entries (if bantime has expired)
+ CNode::SweepBanned(); // clean unused entries (if bantime has expired)
CBanDB bandb;
banmap_t banmap;
CNode::GetBanned(banmap);
- bandb.Write(banmap);
+ if (bandb.Write(banmap))
+ CNode::SetBannedSetDirty(false);
LogPrint("net", "Flushed %d banned node ips/subnets to banlist.dat %dms\n",
- banmap.size(), GetTimeMillis() - nStart);
+ banmap.size(), GetTimeMillis() - nStart);
}