Skip to content

Commit c2410ce

Browse files
committed
refactor: Replace RecursiveMutex with Mutex in timedata.cpp
1 parent 17cfa52 commit c2410ce

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/timedata.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
#include <warnings.h>
1717

1818

19-
static RecursiveMutex cs_nTimeOffset;
20-
static int64_t nTimeOffset GUARDED_BY(cs_nTimeOffset) = 0;
19+
static Mutex g_timeoffset_mutex;
20+
static int64_t nTimeOffset GUARDED_BY(g_timeoffset_mutex) = 0;
2121

2222
/**
2323
* "Never go to sea with two chronometers; take one or three."
@@ -28,7 +28,7 @@ static int64_t nTimeOffset GUARDED_BY(cs_nTimeOffset) = 0;
2828
*/
2929
int64_t GetTimeOffset()
3030
{
31-
LOCK(cs_nTimeOffset);
31+
LOCK(g_timeoffset_mutex);
3232
return nTimeOffset;
3333
}
3434

@@ -46,7 +46,7 @@ static int64_t abs64(int64_t n)
4646

4747
void AddTimeData(const CNetAddr& ip, int64_t nOffsetSample)
4848
{
49-
LOCK(cs_nTimeOffset);
49+
LOCK(g_timeoffset_mutex);
5050
// Ignore duplicates
5151
static std::set<CNetAddr> setKnown;
5252
if (setKnown.size() == BITCOIN_TIMEDATA_MAX_SAMPLES)

0 commit comments

Comments
 (0)