Skip to content

Commit 03cf6e8

Browse files
committed
Merge #7959: fix race that could fail to persist a ban
f4ac02e fix race that could fail to persist a ban (Kaz Wesley)
2 parents 86b800c + f4ac02e commit 03cf6e8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/net.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2634,9 +2634,10 @@ void DumpBanlist()
26342634

26352635
CBanDB bandb;
26362636
banmap_t banmap;
2637+
CNode::SetBannedSetDirty(false);
26372638
CNode::GetBanned(banmap);
2638-
if (bandb.Write(banmap))
2639-
CNode::SetBannedSetDirty(false);
2639+
if (!bandb.Write(banmap))
2640+
CNode::SetBannedSetDirty(true);
26402641

26412642
LogPrint("net", "Flushed %d banned node ips/subnets to banlist.dat %dms\n",
26422643
banmap.size(), GetTimeMillis() - nStart);

0 commit comments

Comments
 (0)