mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-06-04 16:32:32 +02: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:
parent
5c4f0c4d46
commit
2da95545ea
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user