diff options
author | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2022-01-26 16:25:58 +0200 |
---|---|---|
committer | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2022-01-28 19:26:27 +0000 |
commit | 5e20e9ec3859205c220867ca49efb752b8edaacc (patch) | |
tree | 71f39737c772a614ee17956dbb023711315ea6aa /src | |
parent | e3699b71c46bf66cfe363fc76ab8761dc39555a7 (diff) |
Prevent possible concurrent CBanDB::Write() calls
Diffstat (limited to 'src')
-rw-r--r-- | src/banman.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
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 <netaddress.h> #include <node/ui_interface.h> +#include <sync.h> #include <util/system.h> #include <util/time.h> #include <util/translation.h> @@ -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; |