mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 15:09:59 +01:00
refactor: Apply consistent pattern for CAddrMan::Check usage
Co-authored-by: John Newbery <john@johnnewbery.com>
This commit is contained in:
@@ -550,14 +550,11 @@ public:
|
|||||||
|
|
||||||
//! Randomly select an address in tried that another address is attempting to evict.
|
//! Randomly select an address in tried that another address is attempting to evict.
|
||||||
CAddrInfo SelectTriedCollision()
|
CAddrInfo SelectTriedCollision()
|
||||||
{
|
|
||||||
CAddrInfo ret;
|
|
||||||
{
|
{
|
||||||
LOCK(cs);
|
LOCK(cs);
|
||||||
Check();
|
Check();
|
||||||
ret = SelectTriedCollision_();
|
const CAddrInfo ret = SelectTriedCollision_();
|
||||||
Check();
|
Check();
|
||||||
}
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -565,14 +562,11 @@ public:
|
|||||||
* Choose an address to connect to.
|
* Choose an address to connect to.
|
||||||
*/
|
*/
|
||||||
CAddrInfo Select(bool newOnly = false)
|
CAddrInfo Select(bool newOnly = false)
|
||||||
{
|
|
||||||
CAddrInfo addrRet;
|
|
||||||
{
|
{
|
||||||
LOCK(cs);
|
LOCK(cs);
|
||||||
Check();
|
Check();
|
||||||
addrRet = Select_(newOnly);
|
const CAddrInfo addrRet = Select_(newOnly);
|
||||||
Check();
|
Check();
|
||||||
}
|
|
||||||
return addrRet;
|
return addrRet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user