mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-18 16:42:54 +01:00
Prevent possible concurrent CBanDB::Write() calls
This commit is contained in:
@@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
#include <netaddress.h>
|
#include <netaddress.h>
|
||||||
#include <node/ui_interface.h>
|
#include <node/ui_interface.h>
|
||||||
|
#include <sync.h>
|
||||||
#include <util/system.h>
|
#include <util/system.h>
|
||||||
#include <util/time.h>
|
#include <util/time.h>
|
||||||
#include <util/translation.h>
|
#include <util/translation.h>
|
||||||
@@ -39,6 +40,9 @@ BanMan::~BanMan()
|
|||||||
|
|
||||||
void BanMan::DumpBanlist()
|
void BanMan::DumpBanlist()
|
||||||
{
|
{
|
||||||
|
static Mutex dump_mutex;
|
||||||
|
LOCK(dump_mutex);
|
||||||
|
|
||||||
SweepBanned(); // clean unused entries (if bantime has expired)
|
SweepBanned(); // clean unused entries (if bantime has expired)
|
||||||
|
|
||||||
if (!BannedSetIsDirty()) return;
|
if (!BannedSetIsDirty()) return;
|
||||||
|
|||||||
Reference in New Issue
Block a user