From 5e20e9ec3859205c220867ca49efb752b8edaacc Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Wed, 26 Jan 2022 16:25:58 +0200 Subject: Prevent possible concurrent CBanDB::Write() calls --- src/banman.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/banman.cpp') diff --git a/src/banman.cpp b/src/banman.cpp index 95b927c1ff..7fa489b051 100644 --- a/src/banman.cpp +++ b/src/banman.cpp @@ -7,6 +7,7 @@ #include #include +#include #include #include #include @@ -39,6 +40,9 @@ BanMan::~BanMan() void BanMan::DumpBanlist() { + static Mutex dump_mutex; + LOCK(dump_mutex); + SweepBanned(); // clean unused entries (if bantime has expired) if (!BannedSetIsDirty()) return; -- cgit v1.2.3