test: Drop excessive locking in CAddrManTest::SimConnFail
The unit test is single threaded, so there's no need to hold the mutex between Good() and Attempt(). This change avoids recursive locking in the CAddrMan::Attempt function. Co-authored-by: John Newbery <john@johnnewbery.com>
This commit is contained in:
1 parent
5c4f0c4d46
commit
2da95545ea
1 file changed
+2
-2
@@ -74,9 +74,9 @@ public:
|
|||||||
// Simulates connection failure so that we can test eviction of offline nodes
|
// Simulates connection failure so that we can test eviction of offline nodes
|
||||||
void SimConnFail(const CService& addr)
|
void SimConnFail(const CService& addr)
|
||||||
{
|
{
|
||||||
LOCK(cs);
|
|
||||||
int64_t nLastSuccess = 1;
|
int64_t nLastSuccess = 1;
|
||||||
Good_(addr, true, nLastSuccess); // Set last good connection in the deep past.
|
// Set last good connection in the deep past.
|
||||||
|
Good(addr, true, nLastSuccess);
|
||||||
|
|
||||||
bool count_failure = false;
|
bool count_failure = false;
|
||||||
int64_t nLastTry = GetAdjustedTime()-61;
|
int64_t nLastTry = GetAdjustedTime()-61;
|
||||||
|
|||||||
Reference in new issue
Block a user