From 3e9f6c821beb58f882356141efe9140e66d00c0d Mon Sep 17 00:00:00 2001 From: practicalswift Date: Mon, 8 Oct 2018 15:50:09 +0200 Subject: Add missing locks and locking annotations for CAddrMan --- src/test/addrman_tests.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/test/addrman_tests.cpp') 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. -- cgit v1.2.3