aboutsummaryrefslogtreecommitdiff
path: root/src/addrman.h
diff options
context:
space:
mode:
authorHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2021-05-23 19:40:21 +0300
committerHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2021-06-14 17:28:37 +0300
commitf79a664314b88941c1a2796623e846d0a5916c06 (patch)
tree82f1ba8a72eca87980ff6cf28e6ff6768e18e1ac /src/addrman.h
parent187b7d2bb36e6de9cd960378021ebe690619a2ef (diff)
refactor: Apply consistent pattern for CAddrMan::Check usage
Co-authored-by: John Newbery <john@johnnewbery.com>
Diffstat (limited to 'src/addrman.h')
-rw-r--r--src/addrman.h22
1 files changed, 8 insertions, 14 deletions
diff --git a/src/addrman.h b/src/addrman.h
index 3474153e36..2250d1a14c 100644
--- a/src/addrman.h
+++ b/src/addrman.h
@@ -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;
}