mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01:00
refactor: Apply consistent pattern for CAddrMan::Check usage
Co-authored-by: John Newbery <john@johnnewbery.com>
This commit is contained in:
@@ -551,13 +551,10 @@ 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);
|
||||||
{
|
Check();
|
||||||
LOCK(cs);
|
const CAddrInfo ret = SelectTriedCollision_();
|
||||||
Check();
|
Check();
|
||||||
ret = SelectTriedCollision_();
|
|
||||||
Check();
|
|
||||||
}
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -566,13 +563,10 @@ public:
|
|||||||
*/
|
*/
|
||||||
CAddrInfo Select(bool newOnly = false)
|
CAddrInfo Select(bool newOnly = false)
|
||||||
{
|
{
|
||||||
CAddrInfo addrRet;
|
LOCK(cs);
|
||||||
{
|
Check();
|
||||||
LOCK(cs);
|
const CAddrInfo addrRet = Select_(newOnly);
|
||||||
Check();
|
Check();
|
||||||
addrRet = Select_(newOnly);
|
|
||||||
Check();
|
|
||||||
}
|
|
||||||
return addrRet;
|
return addrRet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user