Skip to content

Commit 5e20e9e

Browse files
committed
Prevent possible concurrent CBanDB::Write() calls
1 parent e3699b7 commit 5e20e9e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/banman.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
#include <netaddress.h>
99
#include <node/ui_interface.h>
10+
#include <sync.h>
1011
#include <util/system.h>
1112
#include <util/time.h>
1213
#include <util/translation.h>
@@ -39,6 +40,9 @@ BanMan::~BanMan()
3940

4041
void BanMan::DumpBanlist()
4142
{
43+
static Mutex dump_mutex;
44+
LOCK(dump_mutex);
45+
4246
SweepBanned(); // clean unused entries (if bantime has expired)
4347

4448
if (!BannedSetIsDirty()) return;

0 commit comments

Comments
 (0)