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

f4ac02e fix race that could fail to persist a ban (Kaz Wesley)
This commit is contained in:
Wladimir J. van der Laan 2016-05-02 14:48:47 +02:00
commit 03cf6e8675
No known key found for this signature in database
GPG key ID: 74810B012346C9A6

View file

@ -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);