diff options
author | practicalswift <practicalswift@users.noreply.github.com> | 2018-10-08 15:50:09 +0200 |
---|---|---|
committer | practicalswift <practicalswift@users.noreply.github.com> | 2018-10-08 17:19:25 +0200 |
commit | 3e9f6c821beb58f882356141efe9140e66d00c0d (patch) | |
tree | f626a5be13ae6f5d92005c6eb093e5dfbe2cbc2d /src/test | |
parent | 3315007e03f5cc6c89a221ec7e0bc09a89858304 (diff) |
Add missing locks and locking annotations for CAddrMan
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/addrman_tests.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/test/addrman_tests.cpp b/src/test/addrman_tests.cpp index ee3650d148..fbe438092e 100644 --- a/src/test/addrman_tests.cpp +++ b/src/test/addrman_tests.cpp @@ -40,22 +40,26 @@ public: CAddrInfo* Find(const CNetAddr& addr, int* pnId = nullptr) { + LOCK(cs); return CAddrMan::Find(addr, pnId); } CAddrInfo* Create(const CAddress& addr, const CNetAddr& addrSource, int* pnId = nullptr) { + LOCK(cs); return CAddrMan::Create(addr, addrSource, pnId); } void Delete(int nId) { + LOCK(cs); CAddrMan::Delete(nId); } // Simulates connection failure so that we can test eviction of offline nodes void SimConnFail(CService& addr) { + LOCK(cs); int64_t nLastSuccess = 1; Good_(addr, true, nLastSuccess); // Set last good connection in the deep past. |