Permalink
Browse files

Merge #7959: fix race that could fail to persist a ban

f4ac02e fix race that could fail to persist a ban (Kaz Wesley)
  • Loading branch information...
laanwj committed May 2, 2016
2 parents 86b800c + f4ac02e commit 03cf6e86750218f633498210923544f4a6c3c020
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/net.cpp
View
@@ -2634,9 +2634,10 @@ void DumpBanlist()
CBanDB bandb;
banmap_t banmap;
CNode::SetBannedSetDirty(false);
CNode::GetBanned(banmap);
if (bandb.Write(banmap))
CNode::SetBannedSetDirty(false);
if (!bandb.Write(banmap))
CNode::SetBannedSetDirty(true);
LogPrint("net", "Flushed %d banned node ips/subnets to banlist.dat %dms\n",
banmap.size(), GetTimeMillis() - nStart);

0 comments on commit 03cf6e8

Please sign in to comment.