addrman: Add missing lock in Clear() (CAddrMan)

The variable vRandom is guarded by the mutex cs.
This commit is contained in:
practicalswift 2017-10-31 10:25:09 +01:00
parent bb9ab0fccf
commit 3ab545d7f8

View File

@ -455,6 +455,7 @@ public:
void Clear() void Clear()
{ {
LOCK(cs);
std::vector<int>().swap(vRandom); std::vector<int>().swap(vRandom);
nKey = GetRandHash(); nKey = GetRandHash();
for (size_t bucket = 0; bucket < ADDRMAN_NEW_BUCKET_COUNT; bucket++) { for (size_t bucket = 0; bucket < ADDRMAN_NEW_BUCKET_COUNT; bucket++) {