mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-10 20:03:34 -03:00
refactor: Apply consistent pattern for CAddrMan::Check usage
Co-authored-by: John Newbery <john@johnnewbery.com>
This commit is contained in:
parent
187b7d2bb3
commit
f79a664314
1 changed files with 8 additions and 14 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue