Skip to content

Commit 3ab545d

Browse files
addrman: Add missing lock in Clear() (CAddrMan)
The variable vRandom is guarded by the mutex cs.
1 parent bb9ab0f commit 3ab545d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/addrman.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,7 @@ class CAddrMan
455455

456456
void Clear()
457457
{
458+
LOCK(cs);
458459
std::vector<int>().swap(vRandom);
459460
nKey = GetRandHash();
460461
for (size_t bucket = 0; bucket < ADDRMAN_NEW_BUCKET_COUNT; bucket++) {

0 commit comments

Comments
 (0)