Prevent possible concurrent CBanDB::Write() calls

This commit is contained in:
Hennadii Stepanov 2022-01-26 16:25:58 +02:00
parent e3699b71c4
commit 5e20e9ec38
No known key found for this signature in database
GPG Key ID: 410108112E7EA81F

View File

@ -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;