mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01:00
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:
@@ -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