refactor: Apply consistent pattern for CAddrMan::Check usage

Co-authored-by: John Newbery <john@johnnewbery.com>
This commit is contained in:
Hennadii Stepanov 2021-05-23 19:40:21 +03:00
parent 187b7d2bb3
commit f79a664314
No known key found for this signature in database
GPG key ID: 410108112E7EA81F

View file

@ -551,13 +551,10 @@ public:
//! Randomly select an address in tried that another address is attempting to evict.
CAddrInfo SelectTriedCollision()
{
CAddrInfo ret;
{
LOCK(cs);
Check();
ret = SelectTriedCollision_();
Check();
}
LOCK(cs);
Check();
const CAddrInfo ret = SelectTriedCollision_();
Check();
return ret;
}
@ -566,13 +563,10 @@ public:
*/
CAddrInfo Select(bool newOnly = false)
{
CAddrInfo addrRet;
{
LOCK(cs);
Check();
addrRet = Select_(newOnly);
Check();
}
LOCK(cs);
Check();
const CAddrInfo addrRet = Select_(newOnly);
Check();
return addrRet;
}