mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-02 09:46:52 -05: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
1 changed files with 2 additions and 2 deletions
|
@ -74,9 +74,9 @@ public:
|
|||
// Simulates connection failure so that we can test eviction of offline nodes
|
||||
void SimConnFail(const CService& addr)
|
||||
{
|
||||
LOCK(cs);
|
||||
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;
|
||||
int64_t nLastTry = GetAdjustedTime()-61;
|
||||
|
|
Loading…
Add table
Reference in a new issue