diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2016-05-02 14:48:47 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2016-05-02 14:48:50 +0200 |
commit | 03cf6e86750218f633498210923544f4a6c3c020 (patch) | |
tree | 419bf3d505eae9bb7755acb23a957929b3200742 /src | |
parent | 86b800c6a299455580fe76e5fb43218f0222e179 (diff) | |
parent | f4ac02ee7c6530c273503d8575a492e9b2ac1f13 (diff) |
Merge #7959: fix race that could fail to persist a ban
f4ac02e fix race that could fail to persist a ban (Kaz Wesley)
Diffstat (limited to 'src')
-rw-r--r-- | src/net.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/net.cpp b/src/net.cpp index 7dec8fc1cf..f566af24c4 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -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); |