Permalink
Browse files

[net] listbanned RPC and QT should show correct banned subnets

Github-Pull: #10234
Rebased-From: 77c54b2
  • Loading branch information...
1 parent 0422693 commit d289b564e3ae125cb54c3d9157a13e7bad48c5f5 @jnewbery jnewbery committed with luke-jr Apr 19, 2017
Showing with 5 additions and 3 deletions.
  1. +5 −3 src/net.cpp
View
@@ -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
}

0 comments on commit d289b56

Please sign in to comment.