aboutsummaryrefslogtreecommitdiff
path: root/src/net.cpp
diff options
context:
space:
mode:
authorLuke Dashjr <[email protected]>2017-06-05 22:57:27 +0000
committerLuke Dashjr <[email protected]>2017-06-05 22:57:27 +0000
commite05799a381191d603f697225d7a972a735ec8608 (patch)
treeceb437d58d4f441209b6b072856589d0c0a1c48b /src/net.cpp
parentMerge #9853 via branch 'fixerrorcodes-0.14' into 0.14.2_fixes (diff)
parent[tests] update disconnect_ban.py test case to work with listbanned (diff)
downloaddiscoin-e05799a381191d603f697225d7a972a735ec8608.tar.xz
discoin-e05799a381191d603f697225d7a972a735ec8608.zip
Merge #10234, #10143 (fixes only), and #9853 via branch 'disconnect_ban_fixes-0.14' into 0.14.2_fixes
Diffstat (limited to 'src/net.cpp')
-rw-r--r--src/net.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/net.cpp b/src/net.cpp
index 1752c7707..5bc886c34 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -413,10 +413,10 @@ void CConnman::DumpBanlist()
CBanDB bandb;
banmap_t banmap;
- SetBannedSetDirty(false);
GetBanned(banmap);
- if (!bandb.Write(banmap))
- SetBannedSetDirty(true);
+ if (bandb.Write(banmap)) {
+ SetBannedSetDirty(false);
+ }
LogPrint("net", "Flushed %d banned node ips/subnets to banlist.dat %dms\n",
banmap.size(), GetTimeMillis() - nStart);
@@ -536,6 +536,8 @@ bool CConnman::Unban(const CSubNet &subNet) {
void CConnman::GetBanned(banmap_t &banMap)
{
LOCK(cs_setBanned);
+ // Sweep the banlist so expired bans are not returned
+ SweepBanned();
banMap = setBanned; //create a thread safe copy
}