Skip to content

Commit

Permalink
addrman: Add missing lock in Clear() (CAddrMan)
Browse files Browse the repository at this point in the history
The variable vRandom is guarded by the mutex cs.
  • Loading branch information
practicalswift committed Oct 31, 2017
1 parent bb9ab0f commit 3ab545d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/addrman.h
Expand Up @@ -455,6 +455,7 @@ class CAddrMan

void Clear()
{
LOCK(cs);
std::vector<int>().swap(vRandom);
nKey = GetRandHash();
for (size_t bucket = 0; bucket < ADDRMAN_NEW_BUCKET_COUNT; bucket++) {
Expand Down

0 comments on commit 3ab545d

Please sign in to comment.