aboutsummaryrefslogtreecommitdiff
path: root/src/net.cpp
diff options
context:
space:
mode:
authorJohn Newbery <[email protected]>2017-04-19 12:49:11 -0400
committerLuke Dashjr <[email protected]>2017-06-05 22:56:05 +0000
commitd289b564e3ae125cb54c3d9157a13e7bad48c5f5 (patch)
tree5057986a44e16c014e05f9c11460ca28b0e99692 /src/net.cpp
parent[tests] disconnect_ban: remove dependency on urllib (diff)
downloaddiscoin-d289b564e3ae125cb54c3d9157a13e7bad48c5f5.tar.xz
discoin-d289b564e3ae125cb54c3d9157a13e7bad48c5f5.zip
[net] listbanned RPC and QT should show correct banned subnets
Github-Pull: #10234 Rebased-From: 77c54b270dd3b469d662c8f69e06f7b00fc4136d
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
}